Repository navigation
defk-wnu: measure the code-layout noise band and state the rule - #84
Merged
Merged
Conversation
bench/layout_noise.exs builds one kernel 8 times with only its code addresses moved (an unused function of 0-48 bytes before it, through a CC wrapper) and measures the first build under two more labels as an A/A control. On a quiet machine, 15 rounds: integer loops move 2.9-3.6% with layout against 0.2-2.1% for the control; sum and dot 1.2-1.9%, near their control. docs/performance.md gets entry 1.10 and the rule in 1.7: a difference inside a kernel's layout range can be layout alone.
DanielLuning
pushed a commit
that referenced
this pull request
Oct 26, 2026
… ../defk-wnu). Quiet run 2026-10-26, 15 rounds: integer loops layout range 2.9-3.6% vs A/A control 0.2-2.1%; sum/dot 1.2-1.9%, near control. mix ci passed. Close after merge; defk-w8r.4 then unblocks."
DanielLuning
pushed a commit
that referenced
this pull request
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Owner decision 2026-10-26: make the layout noise visible first (this PR); the
-falign-*experiment is the follow-updefk-w8r.4, measured with this band.bench/layout_noise.exs: builds one module of five kernels 8 times with only the code addresses moved. ACCwrapper per build passes-includeof a header with an unused function of 0-48 bytes, so every function after it moves by that many bytes (checked withnm -non the built.sofiles; the C differs only in the module name inERL_NIF_INIT, which is data). The first build is also measured under two more labels as an A/A control. Interleaved rounds, the order rotated each round, best of 3 per label per round; it prints per-label medians, the layout range, the same-build range andcount_primes' round-bests.docs/performance.md: new entry 1.10 with the numbers; 1.7 points to it and gets the rule (a difference inside a kernel's layout range can be layout alone); 1.7's source line no longer callsdefk-9p6.24open.Results
Quiet machine (other processes 0.65-0.67 cores), 15 rounds, one run:
count_primes(300_000)count_primes_via_call(300_000)count_primes_early(1_000_000)sum, 1M[f64]dot, 2 x 1M[f64]The integer loops move with layout well beyond their control (pad 40 made
count_primes~3% faster than pad 0 in 10 of 11 rounds outside a slow stretch); the float loops do not clearly. Rounds 8-11 were 8-10% slower for every build at once; the interleaving spreads that over all builds. A first 9-round run without the control gave the same picture (layout ranges 0.4-4.1%).How it was checked
mix cion an M-series Mac in the worktree: 2326 tests passed. No test runs the bench scripts; the script was smoke-run and then run in full.CHANGELOG.mdentry.test/stability/? No.