Repository navigation
defk-o08.4: each statement's reads walked once on entering it - #70
Merged
Merged
Conversation
Entering a statement computed its reads three times: live_after/1 (stmt_reads/1), the compiler's hoist/3 and Copies.enter_stmt/4 (reads/1, the same set). Copies.block_liveness/1 keeps each statement's reads beside its live set and enter/3 hands them on; live_after/1 and enter_stmt/4 stay. C byte-identical; the compiler's work -8.6% (reductions), time -5.4%: +7.4% of the work before the symbolic-bounds chain, under ADR-0007's ceiling again (docs/performance.md 6.40).
DanielLuning
pushed a commit
that referenced
this pull request
Oct 20, 2026
2 tasks done
DanielLuning
pushed a commit
that referenced
this pull request
Oct 20, 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
Entering a statement computed the same read set three times:
Copies.live_after/1, throughstmt_reads/1;hoist/3, throughCopies.reads/1;Copies.enter_stmt/4, throughreads/1again.reads/1of a statement is itsstmt_reads/1, becauseread_counts/1already skips a match's left side.Copies.block_liveness/1returns, for each statement of a block,{live after it, its reads}from one walk.live_after/1is now a view of it, and its tests stay.enter/3takes{live, reads}and hands the reads tohoist/4and to the newCopies.enter_stmt/5.enter_stmt/4stays and computes the reads itself.test/copies_test.exschecks two claims on generated blocks:reads(e) == stmt_reads(e), andblock_liveness/1agrees withlive_after/1andreads/1.docs/performance.md6.40, and ADR-0007's cost note.Results
mix dump_cis byte-identical for all 108 modules. The only difference is the known path-hasheddefk:loopkey inDefk.ReportTest.Gen.c.DEFK_COMPILE_TIMEharness (defk-o08.2: compiler time measured warm in a fresh process; the chain measured again against its budget #68), two interleaved rounds againstmain:SatEx.Kernels);SatEx.Kernels), down from +17.6%. That is under ADR-0007's +15% ceiling again.Provisional: the laptop was on battery, with no quiet-machine check.
How it was checked
mix cion the laptop (macOS) passed: 2304 tests, Credo found no issues, Dialyzer reported 0 errors.The byte-identical
mix dump_cgate, against an untouchedmaincheckout.Touches a promised surface? No. No
CHANGELOG.mdentry.Touches
test/stability/? No.