Skip to content

issues: a userland forward copy a short way above its source modulo 4 KiB stalls on AMD - #1198

Draft
Japabu wants to merge 1 commit into
mainfrom
memcpy-alias-finding
Draft

Japabu wants to merge 1 commit into
mainfrom
memcpy-alias-finding

Conversation

@Japabu

@Japabu Japabu commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Problem

#1133 measured a real stall in userland's memcpy on the AMD bench (Zen 2). It is closed, because round 12's binding outcome rejected every routed build. The stall it measured, and the cost that sank its fix, need a record so they don't vanish with the PR.

Change

Record-only: adds issues/a-userland-forward-copy-a-short-way-above-its-source-modulo-4-kib-stalls-on-amd.md (kind: finding). It holds:

  • the vendor fact, 56305 rev. 3.02 §2.12 p. 39;
  • the AMD stall, from 256 B to 64 MiB, with the T14's unexplained window;
  • what libc: a forward copy a short way above its source modulo 4 KiB copies down #1133's descending copy fixed;
  • the cost every routed build carried: about 7% on never-routed 256 KiB copies, with or without the AVX loop, and not reproduced by moving base's memcpy;
  • an exit for a future approach, judged on the same paired-boot rule.

Checks

  • cargo test --lib -- sourcegate::tests::no_tracked_file_identifies_a_machine_or_its_network with the file tracked: exit 0.
  • No code changes, so no host CI or guest run.
  • Every number in the file cites its round on ToyOSOrg/evidence branch pr-1133.

🤖 Generated with Claude Code

… KiB stalls on AMD

#1133 measured libc's forward rep movsb stalling on the AMD bench (Zen 2)
when the destination sits 1-31 bytes above the source modulo 4 KiB: 3x at
256 B, 22x at 8 KiB, 3.5x at 1 MiB. 56305 rev. 3.02 §2.12 explains why: it
judges store-to-load forwarding by address bits 11:0.

Its route through a descending loop fixed the stall. Round 12, whose outcome
was binding, closed #1133 instead: every routed build, with or without the
AVX loop, ran never-routed 256 KiB copies about 7% slower in 5 of 5 paired
boots. A base whose memcpy was merely moved did not, so the cost is in the
routed code and its mechanism is unknown. This records the stall, the cost
and an exit for a future approach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant