feat(ir): keep modules of two majors apart #361
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/325-two-majors-identity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task
Issue #325: keep the modules of two majors of one package apart in lowering and the back ends. The checker already did (#324); a program that reached both was refused when lowered.
What
Workspace.identityOf(package): the barenamewhere the workspace holds one package of that name,name@majorfor each where it holds several (a version that does not parse falls back to the bare name).symbolPathOf,scriptNameOf/entryNameOf,stablePathOf,qualifiedNameOfand the reference model'spackageNameOf. Thestd/*by-name lookups stay bare.packageInTwoMajorsguard and its unused imports are removed.docs/tooling/torb-add.md,skills/regenerated (docs skill --checkclean).Granularity is the workspace: a workspace with one package per name (the compiler's own included) produces byte-identical output, no golden changes.
Test
compiler/tests/two-majors.test.trb: identities, lowering names (functions, statics, layout text), stable paths, bytecode chunks and location paths, C text, a VM run over both majors with coverage,torb docreference packages. The old guard test incheck.test.trbis replaced by positive tests on a sharedmajorsTreefixture.torb format --checkon all touched files,torb check compiler/src compiler/tests/two-majors.test.trb(no problems), the check.test group (5 pass), two-majors tests 6 of 7 under the interpreted toolchain; the VM-run test needs a native run (the VM cannot nesttorb_machine_install). Gates run in CI.Closes #325
seed impact: none
a82f30b4acd8e9b575bfApproved at
d8e9b57.two-majors.test.trbcovers identities, lowering names, stable paths, bytecode chunks/locations, C text, a VM run andtorb doc; the old guard test is replaced by positive tests. CI gates, tier A/B, bootstrap and the C-equality check are green on this head.identityOfis bare for a single package andname@majorfor several, falling back to the bare name on an unparsable version. Every name and path derivation in the lowering (symbolPathOf,scriptNameOf/entryNameOf,stablePathOf,qualifiedNameOf) and the reference model goes through it, and the guard and its imports are removed cleanly. Single-major workspaces stay byte-identical (no golden changes).skills/is regenerated. The pdisc check is green.Non-blocking:
vm/coverage-report.trb(lines 132, 168, 181) andvm/run.trb:235still label coverage by the barepackage.name. With two majors, per-package coverage lines would read the same. Worth a follow-up.