Repository navigation
Conversation
The walk of the naming replay offers each statement it takes out of a list to the seal (new src/bir/lower/seal.rs, `seal::step`), which applies the flatten rules F1 to F8 through the interface only: no node is read. The new side of check mode stops running the flatten pass: it qualifies and finishes the sealed program (`finish_flattened_output`); the backend in use flattens where it did, written out where `finish_lowered_output` was called, and that helper is deleted. The oracles flatten the legacy side and their passes lists lose pass 1. Frame gains the seal marks (24 bytes); Held gains the literal and body modes (still 24); the work stack is reserved once by the node count, one more allocation per fresh unit (pins 86, 104, 86, 156). Co-authored-by: Jaap Frolich <jfrolich@gmail.com> Session: https://os.submodule.nl/session/bks-db4a997e-9832-772d-8eb1-c67590c7626b Signed-off-by: open-session-submodule[bot] <341020755+open-session-submodule[bot]@users.noreply.github.com>
Thirteen tests in names.rs, one per rule F1 to F8 and for the modes, dropped literals, the one offer per statement at any width and depth (10,000), the splice of 10,000 nested blocks, the printed branch and the location of a written conditional; three in oracle_tests.rs for globals in branches the seal makes a list of and the location the seal gives to the `if` it writes. Each hand-built tree is judged by `Unit::sealed` against the flatten pass, and by `bir_passes_oracle` after it. Co-authored-by: Jaap Frolich <jfrolich@gmail.com> Session: https://os.submodule.nl/session/bks-db4a997e-9832-772d-8eb1-c67590c7626b Signed-off-by: open-session-submodule[bot] <341020755+open-session-submodule[bot]@users.noreply.github.com>
Co-authored-by: Jaap Frolich <jfrolich@gmail.com> Session: https://os.submodule.nl/session/bks-db4a997e-9832-772d-8eb1-c67590c7626b Signed-off-by: open-session-submodule[bot] <341020755+open-session-submodule[bot]@users.noreply.github.com>
jfrolich
marked this pull request as ready for review
November 29, 2026 16:31
This branch has not been deployed
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.
The naming replay's walk now applies the flatten rules F1 to F8 to each statement it takes out of a list (new
src/bir/lower/seal.rs, through theJs/JsStmtinterface only). The new side of check mode no longer runs the flatten pass: it callsbridge_j::qualifyandfinish_flattened_output. The backend in use flattens where it did before: the call is written out wherefinish_lowered_outputwas called, and that helper is deleted. The oracles flatten the legacy side, and their pass lists lose pass 1. Design:compiler-rust/docs/THREE_TREES.md11.4, "T6u: the seal".The two posted diffs were applied with
git applyas they are, with no retyping or formatting.Commits
changes/three-trees-t6u.internal.md.git diff --numstatof commit 1: export.rs 4/0, ffi_args.rs 3/0, globals.rs 5/2, mod.rs 6/0, names.rs 194/59, oracle_tests.rs 22/20, seal.rs 433/0, unit.rs 10/5, lam_compile.rs 18/23. Of commit 2: names.rs 489/0, oracle_tests.rs 81/0. Against the start: names.rs 683/59, oracle_tests.rs 103/20, seal.rs 433/0.Pins, sizes, tests
reserve_exactof the seal's work stack (decision 14).Framegrows to 24 bytes (row_sizes).Heldstays at 24. The new testseal::tests::sizespinsModeat 1,Pendingat 8,Marksat 12 andSealedat 88. No othersize_ofmoved.row_sizesandten_thousand_nested_lists_move_each_statement_once, which is now built over nestedifs with the same numbers. In the external-shadow tests, only the lines of item (10) of the task changed: pass 1 is dropped from the pass lists,new_text_assigningloses its1 => flattenarm and that import,step_aanda_copied_function_doubles_…no longer callflatten(..), andexport_coercion_…no longer flattens again.f1_…,f2_…,f3_…,f4_…,f5_…,f6_…,f7_and_f8_…,the_heads_of_a_returned_sequence_are_sealed_with_their_tests_entered,a_function_literal_in_a_branch_the_seal_drops_is_not_entered,the_seal_offers_each_statement_once_at_any_width_and_depth,the_seal_splices_ten_thousand_nested_blocks_into_one_list,a_branch_a_rule_rewrites_prints_as_the_pass_prints_it,the_statement_written_for_a_located_conditional_has_its_location.a_global_in_a_branch_the_seal_makes_a_list_of_is_covered_by_the_list_around_it,a_global_in_a_branch_of_a_conditional_used_for_its_effect_is_covered_by_the_list_around_it,a_located_conditional_gives_its_location_to_the_if_the_seal_writes.#[serde(flatten)]onSwitchStats::sealedand thederives of seal.rs. Nothing uses hashing.Gates
Test filters (passed / failed / ignored):
--lib bir::lower--lib bir::j--lib emit::buildercargo clippy --manifest-path compiler-rust/Cargo.toml --all-targets -- -D warnings: clean after each commit.cargo check --all-targets: 0 warnings.RUSTDOCFLAGS="-D warnings" cargo doc --locked --all-features --no-deps: clean.python3 ../scripts/check_lowering_cost_docs.py --base origin/ocaml-to-rust-rewriteends withcost docs: production functions=608; changed/new=27; missing/generic=0; removed=0.python3 ../scripts/count_lowering_ids.py --self-testprintscount_lowering_ids self-test ok: 33 files, 0 transition calls.| totalline ofpython3 ../scripts/count_lowering_ids.py:| total | 16847 | 64 | 9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 72 || total | 17397 | 64 | 9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 72 |Linesmoves (+550): seal.rs adds 416 non-test lines and names.rs grows.Breaks (each applied alone and undone)
Outcome::Finalarm ofReplay::seal:test result: FAILED. 602 passed; 11 failed. The failures area_function_literal_in_a_branch_the_seal_drops_is_not_entered,f1_…tof6_…,f7_and_f8_…,the_heads_of_a_returned_sequence_are_sealed_with_their_tests_entered,the_seal_offers_each_statement_once_at_any_width_and_depthandthe_seal_splices_ten_thousand_nested_blocks_into_one_list, all innames.seal::unenteredreturnsmode:612 passed; 1 failed, the failure beingthe_heads_of_a_returned_sequence_are_sealed_with_their_tests_entered.seal::locateddoes not locate:611 passed; 2 failed, the failures beingthe_statement_written_for_a_located_conditional_has_its_locationandoracle_tests::a_located_conditional_gives_its_location_to_the_if_the_seal_writes.End-state searches (from compiler-rust)
grep -n apply_js_flatten_pass src/lambda/lam_compile.rs: two lines, 29 (the import) and 903 (the backend in use).grep -c finish_lowered_output src/lambda/lam_compile.rs: 0.seal::step3,set_body_adopting3,set_literal_body_adopting1, the text of the debug assertion 2,seal_dropped_literals4.grep -c 'mod seal' src/bir/lower/mod.rs: 1.js.own(2,js.location(1,locate_stmt1.grep -c apply_js_flatten_pass src/bir/lower/oracle_tests.rs: 4.CI
Instruction count(compare): base 4,357,435,415, head 4,355,492,019, change -1,943,396 (-0.045%). The default build does not reach this code, so this is noise.Backend bridge coverage: zero differences.identicalequalsunitseverywhere (fixtures 504/504 and 617/617, runtime 113/113, tests/tests 807/807), and the job prints "Backend coverage ratchet passed".Naming log against the pass (identical on the base and the build):
Coverage counters, base (trunk 9b76caf) to build:
On every corpus
movesequalsstatements, andscopes,reservedandglobals_qualifiedequal the base's. The runtime and tests/tests figures match the design turn's exactly. The fixtures corpus had not been run under the seal before: it shows no difference andseal_dropped_literalsis 0.Not run
The check-mode
scripts/compare_build_instructions.pycomparison: the sandbox was critically low on memory, and the task says the coordinator measures this figure. No number is given here.Started by Jaap Frolich in this Assistant session