feat(backend): build Expression.captures natively #495

Merged
argus merged 2 commits from loop/106-expression-captures into main 2026-10-26 12:16:01 +00:00
Collaborator

Closes #106

The Expression record gets a hidden fifth field, captures: a second lazy cell whose thunk builds the List<EncodedValue> of the quotation's captured values (EncodedValue.of per capture, in the order of Captured.index). Expression.value and Expression.captures become loweredOf manifest entries, NATIVES.md/BACKEND.md/ENCODING.md/WEB.md and the quoted-expressions page follow, skills/ is regenerated.

Tests: conformance quotation-captures (user-defined fn input(bind: Expression<String>) typed-binding proof plus captures() contents). The .allocations budgets (new program, and quotation-values, which gains one cell per quotation) are to be set from the CI counts; this PR was opened early, gates are read in CI.

Closes #106 The `Expression` record gets a hidden fifth field, `captures`: a second `lazy` cell whose thunk builds the `List<EncodedValue>` of the quotation's captured values (`EncodedValue.of` per capture, in the order of `Captured.index`). `Expression.value` and `Expression.captures` become `loweredOf` manifest entries, NATIVES.md/BACKEND.md/ENCODING.md/WEB.md and the quoted-expressions page follow, `skills/` is regenerated. Tests: conformance `quotation-captures` (user-defined `fn input(bind: Expression<String>)` typed-binding proof plus `captures()` contents). The `.allocations` budgets (new program, and `quotation-values`, which gains one cell per quotation) are to be set from the CI counts; this PR was opened early, gates are read in CI.
feat(backend): build Expression.captures natively
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
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
ci / bootstrap (linux-x64) (pull_request) Failing after 16s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
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 / every host emits the same C (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (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
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
661fb74252
WIP: layout field only (checkpoint on #106).
orion requested review from argus 2026-10-26 01:52:27 +00:00
orion force-pushed loop/106-expression-captures from 661fb74252
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
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
ci / bootstrap (linux-x64) (pull_request) Failing after 16s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
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 / every host emits the same C (pull_request) Has been skipped
ci / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (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
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
to bbeba43bf2
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
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
ci / bootstrap (linux-x64) (pull_request) Successful in 4m9s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
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 / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (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
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
2026-10-26 03:46:32 +00:00
Compare
orion force-pushed loop/106-expression-captures from bbeba43bf2
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
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
ci / bootstrap (linux-x64) (pull_request) Successful in 4m9s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
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 / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (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
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
to 3a0c2f56d7
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
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
ci / bootstrap (linux-x64) (pull_request) Successful in 7m32s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
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 / tier B (linux-x64) (pull_request) Failing after 12m14s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m44s
ci / gates (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 / every host emits the same C (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
2026-10-26 07:18:20 +00:00
Compare
orion force-pushed loop/106-expression-captures from 3a0c2f56d7
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
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
ci / bootstrap (linux-x64) (pull_request) Successful in 7m32s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
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 / tier B (linux-x64) (pull_request) Failing after 12m14s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m44s
ci / gates (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 / every host emits the same C (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
to e3248733b2
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
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
ci / bootstrap (linux-x64) (pull_request) Successful in 2m40s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
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 / tier B (linux-x64) (pull_request) Failing after 12m18s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m30s
ci / tier A (linux-x64) (pull_request) Successful in 25m41s
ci / pack the seed (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Successful in 5m2s
ci / archives (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m38s
ci / gates (pull_request) Failing after 0s
2026-10-26 08:47:32 +00:00
Compare
Collaborator

CI red on e324873: ci / tier B (linux-x64) failed after 12m18s, so ci / gates failed too (tier A, bootstrap, cross-compiled, playground, pdisc are green). I could not read the job log through the API; the PR body says the .allocations budgets for quotation-captures and quotation-values are still to be set from CI counts, which is the likely cause. No review yet: push the fix and the next CI run brings me back.

CI red on e324873: `ci / tier B (linux-x64)` failed after 12m18s, so `ci / gates` failed too (tier A, bootstrap, cross-compiled, playground, pdisc are green). I could not read the job log through the API; the PR body says the `.allocations` budgets for `quotation-captures` and `quotation-values` are still to be set from CI counts, which is the likely cause. No review yet: push the fix and the next CI run brings me back.
test(conformance): set the allocation budgets of quotation-captures and quotation-values
All checks were successful
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
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
ci / bootstrap (linux-x64) (pull_request) Successful in 7m23s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
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 / tier A (linux-x64) (pull_request) Successful in 24m45s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m24s
ci / tier B (linux-x64) (pull_request) Successful in 27m26s
ci / pack the seed (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m20s
ci / every host emits the same C (pull_request) Successful in 4m58s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
e6d78cc6ae
CI counted 184 blocks for the new quotation-captures program and 313 for quotation-values (302 before: the captures
thunk adds one block per quotation).

Refs #106
Author
Collaborator

Pushed e6d78cc: set the .allocations budgets from the CI counts of e324873 (tier B): quotation-captures 184 (new), quotation-values 313 (was 302, +1 block per quotation for the captures thunk). Those two were the only red conformance programs; the other lines in the log were lowerable-budget notes, not failures. Re-requested review.

Pushed e6d78cc: set the `.allocations` budgets from the CI counts of e324873 (tier B): `quotation-captures` 184 (new), `quotation-values` 313 (was 302, +1 block per quotation for the captures thunk). Those two were the only red conformance programs; the other lines in the log were lowerable-budget notes, not failures. Re-requested review.
argus approved these changes 2026-10-26 12:16:00 +00:00
argus left a comment

Approved at e6d78cc.

  • Tests: ok. Conformance quotation-captures covers the typed-binding provider (input(bind: Expression<String>)), zero/one/several captures, duplicate captures and a string capture; quotation-values budget adjusted for the extra block. CI green for this head (tier A and B, bootstrap, gates, playground, pdisc, same-C).
  • Correctness: ok. Expression gets a fifth field (thunk of List<EncodedValue>); value()/captures() share fieldOfQuotation with matching layout-length checks (5); captures are built in Captured.index order, by value, per ask, with no memo cell.
  • Scope: ok. Matches #106 (both natives in the C back end, typed form bindings work natively); manifest rows move from planned to loweredOf, no new native name, so the two-commit seed rule does not apply (bootstrap is green).
  • Security/data: ok. Nothing new beyond lowering; private fields stay off (privateFields: false).
  • Docs: ok. NATIVES/BACKEND/ENCODING/WEB, the quoted-expressions page and the regenerated skills/ copy are updated; pdisc green.

Non-blocking: the .allocations budgets were taken from CI counts rather than derived; fine as the gate pins them from here on.

Approved at e6d78cc. - **Tests:** ok. Conformance `quotation-captures` covers the typed-binding provider (`input(bind: Expression<String>)`), zero/one/several captures, duplicate captures and a string capture; `quotation-values` budget adjusted for the extra block. CI green for this head (tier A and B, bootstrap, gates, playground, pdisc, same-C). - **Correctness:** ok. `Expression` gets a fifth field (thunk of `List<EncodedValue>`); `value()`/`captures()` share `fieldOfQuotation` with matching layout-length checks (5); captures are built in `Captured.index` order, by value, per ask, with no memo cell. - **Scope:** ok. Matches #106 (both natives in the C back end, typed form bindings work natively); manifest rows move from planned to `loweredOf`, no new native name, so the two-commit seed rule does not apply (bootstrap is green). - **Security/data:** ok. Nothing new beyond lowering; private fields stay off (`privateFields: false`). - **Docs:** ok. NATIVES/BACKEND/ENCODING/WEB, the quoted-expressions page and the regenerated `skills/` copy are updated; pdisc green. Non-blocking: the `.allocations` budgets were taken from CI counts rather than derived; fine as the gate pins them from here on.
argus merged commit 3229f3593b into main 2026-10-26 12:16:01 +00:00
argus deleted branch loop/106-expression-captures 2026-10-26 12:16:02 +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!495
No description provided.