Skip to content

bench(gate): sample data placement across simulation layouts - #287

Merged
blackopsrepl merged 1 commit into
mainfrom
gate/data-placement-sampling
Nov 30, 2026
Merged

blackopsrepl merged 1 commit into
mainfrom
gate/data-placement-sampling

Conversation

@blackopsrepl

Copy link
Copy Markdown
Collaborator

bench(gate): sample data placement across simulation layouts

The gate's simulated cache metrics are a median over layouts that differed
only in -C metadata, which reorders functions but leaves data where the
linker puts it. construction_first_fit's data-L1 misses depend on that
placement: on v0.31.4, 896 bytes of unused read-only data moved them -15.4%
on one layout and +0.5% on another, so any change that shifts data could
fail or pass the 5% budget by placement alone (main against v0.31.4 failed
it at +5.6% with identical instructions and allocations).

Each layout now also compiles a read-only pad of (layout * 1984) mod 4096
bytes into the bench (SOLVERFORGE_BENCH_DATA_PAD), the same on both sides,
so the layouts sample code and data placement. Across 21 such placements
construction_first_fit's misses spread 3.9%; two identical-code sides'
medians differed by more than 5.6% in 5% of resamples over 5 placements and
by more than 2.5% over 21, so that case is built in FIRST_FIT_SIM_LAYOUTS
(21) layouts. The extra layouts only feed the simulation; the budget, the
graded metrics and the pass rule are unchanged.

Checked on construction_first_fit with 21 layouts per side:

  • A/A (HEAD vs HEAD), twice: sim_d1_misses -1.43% and -1.25%, passed.
  • Planted regression (24 cache lines touched per first-fit solve):
    sim_d1_misses +27.46% and sim_ll_misses +28.17% failed with
    sim_instructions -0.05% and instructions +0.01%.
  • 21 placements, main 29d7770 vs v0.31.4: median sim_d1_misses -1.1%.

The gate's simulated cache metrics are a median over layouts that differed
only in `-C metadata`, which reorders functions but leaves data where the
linker puts it. construction_first_fit's data-L1 misses depend on that
placement: on v0.31.4, 896 bytes of unused read-only data moved them -15.4%
on one layout and +0.5% on another, so any change that shifts data could
fail or pass the 5% budget by placement alone (main against v0.31.4 failed
it at +5.6% with identical instructions and allocations).

Each layout now also compiles a read-only pad of (layout * 1984) mod 4096
bytes into the bench (SOLVERFORGE_BENCH_DATA_PAD), the same on both sides,
so the layouts sample code and data placement. Across 21 such placements
construction_first_fit's misses spread 3.9%; two identical-code sides'
medians differed by more than 5.6% in 5% of resamples over 5 placements and
by more than 2.5% over 21, so that case is built in FIRST_FIT_SIM_LAYOUTS
(21) layouts. The extra layouts only feed the simulation; the budget, the
graded metrics and the pass rule are unchanged.

Checked on construction_first_fit with 21 layouts per side:
- A/A (HEAD vs HEAD), twice: sim_d1_misses -1.43% and -1.25%, passed.
- Planted regression (24 cache lines touched per first-fit solve):
  sim_d1_misses +27.46% and sim_ll_misses +28.17% failed with
  sim_instructions -0.05% and instructions +0.01%.
- 21 placements, main 29d7770 vs v0.31.4: median sim_d1_misses -1.1%.
@blackopsrepl
blackopsrepl merged commit 69cb0a9 into main Nov 30, 2026
7 checks passed
@blackopsrepl
blackopsrepl deleted the gate/data-placement-sampling branch December 1, 2026 13:27
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