feat(ir): keep modules of two majors apart #361

Merged
argus merged 2 commits from loop/325-two-majors-identity into main 2026-10-13 22:38:29 +00:00
Collaborator

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 bare name where the workspace holds one package of that name, name@major for each where it holds several (a version that does not parse falls back to the bare name).
  • Every name and path derivation goes through it: symbolPathOf, scriptNameOf/entryNameOf, stablePathOf, qualifiedNameOf and the reference model's packageNameOf. The std/* by-name lookups stay bare.
  • The packageInTwoMajors guard and its unused imports are removed.
  • Docs: PROJECT.md 6a rewritten to the built state, RELEASE.md and ROADMAP mark it built, one sentence in docs/tooling/torb-add.md, skills/ regenerated (docs skill --check clean).

Granularity is the workspace: a workspace with one package per name (the compiler's own included) produces byte-identical output, no golden changes.

Test

  • New 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 doc reference packages. The old guard test in check.test.trb is replaced by positive tests on a shared majorsTree fixture.
  • Local, quick only: torb format --check on 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 nest torb_machine_install). Gates run in CI.

Closes #325

seed impact: none

## 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 bare `name` where the workspace holds one package of that name, `name@major` for each where it holds several (a version that does not parse falls back to the bare name). - Every name and path derivation goes through it: `symbolPathOf`, `scriptNameOf`/`entryNameOf`, `stablePathOf`, `qualifiedNameOf` and the reference model's `packageNameOf`. The `std/*` by-name lookups stay bare. - The `packageInTwoMajors` guard and its unused imports are removed. - Docs: PROJECT.md 6a rewritten to the built state, RELEASE.md and ROADMAP mark it built, one sentence in `docs/tooling/torb-add.md`, `skills/` regenerated (`docs skill --check` clean). Granularity is the workspace: a workspace with one package per name (the compiler's own included) produces byte-identical output, no golden changes. ## Test - New `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 doc` reference packages. The old guard test in `check.test.trb` is replaced by positive tests on a shared `majorsTree` fixture. - Local, quick only: `torb format --check` on 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 nest `torb_machine_install`). Gates run in CI. Closes #325 seed impact: none
docs: two majors of one package build and run
Some checks failed
ci / what the change touches (pull_request) Successful in 13s
ci / commit messages (pull_request) Successful in 14s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 14s
ci / the VS Code extension (editors/vscode) (pull_request) Successful in 16s
ci / bootstrap (linux-x64) (pull_request) Successful in 2m10s
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Failing after 4m39s
ci / gates (pull_request) Has been cancelled
ci / every host emits the same C (pull_request) Has been cancelled
ci / the playground (torb as WebAssembly) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
ci / tier B (linux-x64) (pull_request) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been cancelled
dab7c095f4
test(ir): make the two-majors program an entry file
Some checks failed
ci / gates (pull_request) Has been cancelled
pdisc / pdisc (pull_request) Has been cancelled
ci / commit messages (pull_request) Has been cancelled
ci / what the change touches (pull_request) Has been cancelled
a82f30b4ac
orion force-pushed loop/325-two-majors-identity from a82f30b4ac
Some checks failed
ci / gates (pull_request) Has been cancelled
pdisc / pdisc (pull_request) Has been cancelled
ci / commit messages (pull_request) Has been cancelled
ci / what the change touches (pull_request) Has been cancelled
to d8e9b575bf
All checks were successful
ci / tier B (linux-x64) (pull_request) Successful in 11m49s
ci / every host emits the same C (pull_request) Successful in 4m49s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m6s
ci / gates (pull_request) Successful in 0s
images / cr.torb.dev/torbscript/registry (push) Has been skipped
images / cr.torb.dev/torbscript/release-sync (push) Has been skipped
images / cr.torb.dev/torbscript/site (push) Has been skipped
ci / commit messages (push) Successful in 12s
ci / what the change touches (push) Successful in 12s
ci / which runners exist (push) Successful in 1s
ci / bootstrap and conformance (windows-x64) (push) Has been skipped
ci / bootstrap and conformance (linux-arm64) (push) Has been skipped
pdisc / pdisc (push) Successful in 12s
ci / bootstrap and conformance (macos-arm64) (push) Has been skipped
ci / the VS Code extension (editors/vscode) (push) Successful in 16s
ci / bootstrap (linux-x64) (push) Successful in 2m11s
ci / cross-compiled on linux-x64 (windows-x64) (push) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (push) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (push) Has been skipped
ci / tier A (linux-x64) (push) Successful in 4m41s
images / cr.torb.dev/torbscript/site:edge (main) (push) Successful in 8m15s
ci / tools/release-sync and tools/registry (linux-x64) (push) Successful in 2m24s
ci / every host emits the same C (push) Successful in 4m45s
ci / tier B (linux-x64) (push) Successful in 12m6s
ci / pack the seed (push) Has been skipped
ci / archives (push) Has been skipped
ci / the playground (torb as WebAssembly) (push) Successful in 2m5s
ci / gates (push) Successful in 0s
2026-10-13 22:21:27 +00:00
Compare
argus approved these changes 2026-10-13 22:38:28 +00:00
argus left a comment

Approved at d8e9b57.

  • Tests: ok. New two-majors.test.trb covers identities, lowering names, stable paths, bytecode chunks/locations, C text, a VM run and torb 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.
  • Correctness: ok. identityOf is bare for a single package and name@major for 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).
  • Scope: ok. It matches the stated issue #325, with no extras.
  • Security/data: ok. No secrets, dependencies or storage formats touched.
  • Docs: ok. PROJECT.md 6a, RELEASE.md, ROADMAP and torb-add.md are updated, and skills/ is regenerated. The pdisc check is green.

Non-blocking: vm/coverage-report.trb (lines 132, 168, 181) and vm/run.trb:235 still label coverage by the bare package.name. With two majors, per-package coverage lines would read the same. Worth a follow-up.

Approved at d8e9b57. - Tests: ok. New `two-majors.test.trb` covers identities, lowering names, stable paths, bytecode chunks/locations, C text, a VM run and `torb 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. - Correctness: ok. `identityOf` is bare for a single package and `name@major` for 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). - Scope: ok. It matches the stated issue #325, with no extras. - Security/data: ok. No secrets, dependencies or storage formats touched. - Docs: ok. PROJECT.md 6a, RELEASE.md, ROADMAP and torb-add.md are updated, and `skills/` is regenerated. The pdisc check is green. Non-blocking: `vm/coverage-report.trb` (lines 132, 168, 181) and `vm/run.trb:235` still label coverage by the bare `package.name`. With two majors, per-package coverage lines would read the same. Worth a follow-up.
argus merged commit d8e9b575bf into main 2026-10-13 22:38:29 +00:00
argus deleted branch loop/325-two-majors-identity 2026-10-13 22:38:29 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!361
No description provided.