Skip to content

rust-std: store datatype fields behind shared boxes - #441

Merged
afflom merged 12 commits into
release/v0.5from
claude/rust-std-shared-records
Nov 15, 2026
Merged

afflom merged 12 commits into
release/v0.5from
claude/rust-std-shared-records

Conversation

@afflom

@afflom afflom commented Nov 8, 2026

Copy link
Copy Markdown
Member

Requested by Alex · project thread

Summary

In the rust-std profile, any field whose type is a datatype with a field-carrying constructor is now stored behind std::rc::Rc, reusing the existing certified box/unbox path that was previously used only for cyclic fields.

Why

Before this change, records were stored inline. Every projection (match v.clone() { C(.., h, ..) => h }) copied the entire record. In the uorc client, the search cursor alone is about 1.7 KB, so 84% of the run time went to memcpy, and the very large frames overflowed the stack only 8 calls deep.

Effect (uorc client, same certified roots)

  • compress, 100k search steps: 22.7 s → 1.15 s
  • decompress, 2 KB archive: 17.8 s → 3.7 s
  • No stack overflow on the default 8 MiB thread stack.

Known interaction

LLV7015 (certificate B) still rejects a match arm that returns a boxed-field binder directly. Now that more fields are boxed, it occurs more often. uorc works around it with let x : T := binder; x. A fix in data_b/align.rs m_arm (the folded-load path) would remove the need for that workaround.

compression pins this commit until it is released.


Generated by Claude Code

The target's value semantics clones a record to read one field, and Rust
copies an in-place record whole on every clone and move. For a program
whose states are large records this dominates run time (84% memcpy in the
uorc search engine) and gives functions frames large enough to overflow
the default stack. rust-std now boxes every field whose type is a datatype
with a field-carrying constructor, reusing the existing box/unbox
rendering and its certificate; rust-core is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3Nk2H9geAZ2GKFCNvM

afflom commented Nov 8, 2026 •

Copy link
Copy Markdown
Member Author

CI status for this PR, after a9413d6:

Fixed in a9413d6

  • examples (helpdesk) failed with LLI9001, box realizes indirection. A shared box now counts as indirection in rust-std. Verified locally on helpdesk, collections and fold-laws.
  • the_compiler_semantics_records_the_renderer: rust_renderer in language/semantics-1.2.toml now records the new renderer digest.

Expected; needs the landing regeneration

These failures are caused by this PR, and the fix is regeneration rather than a code change:

  • bdd-bootstrap-validate (BS-05): COMMITTED_CRATES is asserted to be 232. The committed corpus now lowers to 215 distinct crates, because boxing record fields makes more programs render the same crate. The counts that depend on it (vectors, evaluator, seeded) move with it, as do model/ids.toml, SPEC.md §17.23 and VERIFICATION.md.
  • bdd-bootstrap-print, bdd-bootstrap-runtime (BS-09) and the BS-01/02/06 cases: the committed rendered fixtures and the bootstrap's certified packages are the pre-change renderings.
  • repro: examples/*/lexlean.lock is stale (LLC0102). The compiler-semantics ID moves with the renderer.

I haven't hand-edited these counts, fixtures or locks. They have to come from the measured regeneration run on the normative host.

Until then, compression pins 7da569d for its Rust export.


Generated by Claude Code

A shared box realizes `indirection` like a cyclic one, so the rendering
check accepts the box a non-recursive record field now lowers to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3Nk2H9geAZ2GKFCNvM
@afflom
afflom marked this pull request as draft November 13, 2026 19:40
@afflom
afflom changed the base branch from main to release/v0.5 November 13, 2026 19:40

afflom commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

Was based on main, which gets a line only at its tag (SPEC §9.4). Retargeted to release/v0.5 and set to draft. It changes rust-std rendering (identity moves), so it lands after #405, with one regeneration.


Generated by Claude Code

The renderer record takes the digest of the merged renderer sources.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
@afflom
afflom marked this pull request as ready for review November 14, 2026 21:07
The rust-std renderer record moves the language-1.2 compiler-semantics ID to
a5ffe0622f46da9bbde0573c9cfea5ac6afbd17192f0c85474d46e7330652b75. Every tracked lock whose only change is that ID is relocked with the
built compiler (268); the lock-schema mismatch fixtures and the negative
fixtures whose locks do not resolve keep their bytes. LANGUAGE_1_2_SEMANTICS_ID
takes the recomputed ID.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
The three negative fixtures whose request pins rust-core now pin its
descriptor digest under the moved renderer, so each reaches the refusal it
records rather than LLC0203.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
afflom pushed a commit that referenced this pull request Nov 15, 2026
#441 lands first on release/v0.5; this head follows it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
afflom pushed a commit that referenced this pull request Nov 15, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
The write recipes of SPEC.md §9.2, run by regenerate.yml (https://github.com/UOR-Foundation/lexlean/actions/runs/43649832487),
rewrote 5502 paths.

The counts writer reported:

    BS-05 SEEDED_REFUSED_VALIDATE: 273 -> 275 (crates/conformance/src/cases/bootstrap/rust_validate.rs)
    BS-05: §31 row: nothing
    BS-05: the §31 row does not state 273 (-> 275)
    BS-05: register: nothing
    BS-05: scenario: nothing

    VERIFICATION.md rows for the landing (counts | before | after):
    | `BS-05` SEEDED_REFUSED_VALIDATE | 273 | 275 |

    wrote /home/runner/work/lexlean/lexlean/CONFORMANCE.md and /home/runner/work/lexlean/lexlean/ERRORS.md

    written, with SPEC.md and the model projected again; next: the parts without LEXLEAN_COUNTS
afflom pushed a commit that referenced this pull request Nov 15, 2026
…olation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
afflom pushed a commit that referenced this pull request Nov 15, 2026
Its lock came from #441 under that change's ID and was skipped by the relock (LLC0102 in fixtures-write).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX

@afflom afflom left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bounded diagnosis of exact e415e4a, run 43660022436 attempt 1, failed job 132662859251 (just vv (bdd-bootstrap-bodies)). The retained log confirms the exact checkout and conformance_bs_11 panic at crates/conformance/src/cases/bootstrap/rust_bodies.rs:690:5: “the roots composed with applyMoves and the oracle disagree on the vectors”, vector 123, run 0. The oracle wraps the nested value:adt in an indirection node; the program retains the raw ADT.

Earlier 157 Rust vector comparisons and 468 evaluator Rust comparisons passed and retain their scoped credit. This log establishes the composition/oracle mismatch; it does not establish whether source, oracle, committed products or their binding is wrong, and it supplies no OOM cause. The later completeness assertion was skipped after the gate failed.

Existing owner next step: inspect that retained vector and the exact applyMoves/committed-root binding, then identify the minimal correction while preserving the assertion and successful evidence. Preserve completed producer 43649832487 and its custody; this is not a request for blanket regeneration or a CI retry. No execution or source mutation was performed in this review. The new job log was fetched once and retained (decoded-text SHA256 912b15e7f94d61eeba98e1c58a05e8bf14e830b03f63cae2d8ee4a9b94c5202c).

The oracle lowering boxes a rust-std field whose type is a datatype with a
fielded constructor; the bootstrap's RustLower now marks those owners
(markShared) so its cyclic test boxes the same fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX

@afflom afflom left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bounded source follow-up at 9624131: the three authored-file repair addresses the missing ADT indirection mechanism in the retained BS11 failure. No new blocker found in this delta. markShared adds field-carrying ADT ownership markers after edge closure at all five lowering sites; cyclic retains true cycles plus the explicit sharing marker. fieldsOk continues using actual cycles, preserving the inhabitance boundary. Function closures are not newly marked as ADTs.

The failed oracle comparison and the vector/mutant/native/export/budget assertions remain intact; no corpus reduction or assertion bypass was introduced. This is source credit, not a claim that BS11 or the generated products now pass.

Existing owner run43671310314 is the current producer for this source. Preserve the earlier43649832487 results and the retained failed-job log at their own bindings; no duplicate producer or log fetch was performed. Next is coherent source-bound output adoption and resulting-head full acceptance/reproducibility, followed by actual merged-tree equality. Existing ownership remains.

The write recipes of SPEC.md §9.2, run by regenerate.yml (https://github.com/UOR-Foundation/lexlean/actions/runs/43671310314),
rewrote 1204 paths.

The counts writer reported:

    counts: no count moved
afflom pushed a commit that referenced this pull request Nov 15, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX

@afflom afflom left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bounded output-adoption readback: a929968 is the direct child of reviewed962413 and names successful producer43671310314. All six producer stages passed; final artifact14149544691 is present/nonexpired with digest9e576c3f91ed7e39f660b4419eb37b9eece56e7c0a043f494a78a9a7449bd35a. Git subtree IDs preserve bootstrap/src and the inspected authored implementation, assertions, schema, model and workflow objects exactly. This credits official output custody and source preservation, not an exhaustive generated-byte audit or passing BS11/full acceptance.

The current blocker is qualification: exact-head PR CI43685038619 and reproducibility43685038656 report action_required; existing dispatched CI43685025045 is pending. This metadata does not establish a test failure or the exact approval reason. The authorized owner should resolve that workflow state and use the existing qualification path, preserving all successful producer results rather than launching another writer set. No approval, retry, CI control, log refetch or artifact download was performed here. Final-head full acceptance and actual merged-tree equality remain required.

rust-std now holds a datatype field with a fielded constructor behind Rc,
so the host driver of RuntimeHost wraps the Start it gives Event::C0 in
Rc::new and clones the Spec out of Request::C10 for process_spawn. The
language-1.2 compiler-semantics ID moves to a15f5fbc; every identity-only
lock and LANGUAGE_1_2_SEMANTICS_ID follow it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX

@afflom afflom left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bounded source follow-up at5026efb9: the compiler and embedded RuntimeHost copies carry the same shared-field adaptation. Event::C0 now constructs its Start payload through Rc::new, and Request::C10 passes an owned Spec via (*spec).clone() to process_spawn. Inspected payload fields, host operation dispatch, arguments/environment and refusal structure remain unchanged. No new blocking source finding in this adaptation.

The identity constant and visible lock changes move to the owner-reported a15f5fbc identity. This review did not recompute identities or audit every lock (the commit listing is capped), and establishes no older-language/product acceptance. Existing exact-source producer43701828582 is already active; finish/disposition that run and review its coherent output adoption before final-head CI/repro and actual merged-tree acceptance. No second wave, runtime test or completed check was started. Receipt adc29330d39cf9e111f502a678c8b6189be6cb5f38f76edc58179ddc5d1c23a9. COMMENT only.

afflom pushed a commit that referenced this pull request Nov 15, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
afflom pushed a commit that referenced this pull request Nov 15, 2026

afflom commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

Producer coordination snapshot: #441 run43701828582 at5026, #437 run43704121680 ata905, and #443 run43706394041 at5143 are concurrently active. Git ancestry confirms c6b9 merged5026 into #437, then d2fc mergeda905 into #443. These are distinct input identities; this observation does not establish identical outputs or authorize cross-head evidence reuse.

Please coordinate the next canonical output-adoption point across this dependency chain and serialize any further identity-changing waves. Preserve each current run's original successes, failures and output custody; finish/disposition the existing runs before launching replacements, and avoid repeating upstream completed work merely because a descendant is ready. No automatic cancellation, retry or producer was performed here, and no launch/partial result is acceptance. Existing implementing owners retain their lanes and final-head/full-gate/actual-tree obligations.

afflom commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

From now on, identity waves go down the chain one at a time: #441, then #437, then #443, then #303, then #295. Each PR adopts its regen output and passes the full gate before its successor merges that adopted head and runs one regen. The regens already running (#441 43701828582, #437 43704121680, #443 43706394041) finish as they are and I record each outcome. #441's output is adopted first.


Generated by Claude Code

github-actions Bot and others added 2 commits November 15, 2026 12:18
The write recipes of SPEC.md §9.2, run by regenerate.yml (https://github.com/UOR-Foundation/lexlean/actions/runs/43701828582),
rewrote 5533 paths.

The counts writer reported:

    counts: no count moved

@afflom afflom left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bounded output/integration review at a516b5a: official regenerate43701828582 on5026 completed all six stages; adoption46faf is its direct child and names that run. Final artifact14161137680 is nonexpired and input-bound. Inspected authored objects are unchanged through adoption; changed descendants classify as generated products. This is API/object custody, not a downloaded artifact byte comparison or an independent count of all5533 rewritten paths.

The subsequent merge [46faf,8a8e3018] brings in accepted #540: its complete eight-file delta matches the upstream path set, patches and final blob SHAs exactly. Existing source/repair/#540 evidence is reused; no new bounded source blocker found. Exact a516 CI43714046523 and repro43714046559 remain queued. Older46faf dispatch43713178669 cannot qualify this merged head; retain its own scope, without duplicate qualification claims.

Existing owner acknowledgement6893439291 controls serialized future identity waves. Finish current-head full qualification and actual merged-tree equality before delivery; no new writer/retry/cancellation or competing work requested. Receipt a66a4493243ac1976614d06b6b7a6d843e8c65185953b010c6bbb803c760f26a. COMMENT only.

afflom pushed a commit that referenced this pull request Nov 15, 2026
#441 lands first; with its head here the tree #545 merges is the tree this
head's gate tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Joined from the atlas-part artifacts of gate run 43714046523 at a516b5a.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3MAztfvN671cYrybev
afflom pushed a commit that referenced this pull request Nov 15, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3MAztfvN671cYrybev

afflom commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

Pushed 4a09ae2: uor-atlas verification records joined from gate 43714046523's atlas parts (its only failure was the stale-record atlas join). Qualifying gate is now 43728330600/43728330653. #545 merged this head as 78a92dc so its merge tree stays equal to its gated tree; its superseded gate 43717127478 is cancelled.


Generated by Claude Code

@afflom afflom left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bounded record-adoption review at 4a09ae2: the complete delta from a516 is confined to examples/uor-atlas/expected/verify audit/probe records. All 87 renamed Lean files retain identical blob SHAs; authored sources and other products are unchanged. Prior source and accepted #540 composition reviews remain reusable.

The 13 Atlas part jobs in run 43714046523 completed successfully and their artifact metadata binds that run/input. This establishes scoped custody, not archive-payload equivalence. The whole run is cancelled; its join failed and native Atlas assertion was skipped. These records cannot turn it into successful full acceptance.

Current-head CI 43728330653 remains queued; repro 43728330600 passed. Existing owner should finish the current full gate, including the joined Atlas assertion, then establish actual merged-tree equality. No producer, log fetch, test or retry repeated. Receipt 8fe267264a2cb0ea7afe5a53a5b98182fb2ad0de2bcba436befc91bdcdc34902. COMMENT only.

@afflom
afflom merged commit 5c07f9f into release/v0.5 Nov 15, 2026
71 checks passed
@afflom
afflom deleted the claude/rust-std-shared-records branch November 15, 2026 21:09

afflom commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

Merged as 5c07f9f. Merged tree da3ae261 equals the gated head 4a09ae2 tree (ci 43728330653, repro 43728330600, all green).


Generated by Claude Code

@afflom afflom left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final delivery readback independently confirms owner comment6901401372. Head4a09ae2b, checked synthetic6ecd1a1e and actual merged5c07f9fa all have tree da3ae261884b65191e3e4c0c6fff522e24eb828d. Actual parents are8a8e3018 +4a09ae2b, preserving release history.

CI43728330653 attempt1 completed70 unique jobs and813 steps, all successful, including substantive Intel construction/execution/inventory and Atlas join/native assertion. Head repro43728330600 passed1job/7steps. Actual repro43762058873 also passed substantive just repro; actual pushCI43762058787 is only a planner with17skipped jobs and is not counted as another full gate. The old canceled Atlas run is preserved separately and contributes nothing to the current success.

The reviewed #441 scope is accepted at the actual merged tree, reusing prior source reviews. No linked issue clearly qualifies for closure; the client timing claims and known LLV7015 interaction remain outside this acceptance. No artifact ZIP equality claim or repeated producer/test.

Immutable receipt pr441-5c07-actual-final-acceptance-20261115.json SHA25648d0f2e463f85b50068846096033e6848f863f6006ff45aaa5548fe6294e8c2d.

afflom pushed a commit that referenced this pull request Nov 15, 2026
…ation proof

Authored conflicts: CHANGELOG keeps both Unreleased entries. Every other
conflict was a generated record, a lock or LANGUAGE_1_2_SEMANTICS_ID; each
takes release/v0.5's side (records it no longer has are removed), and the
regenerate run's identity job relocks and rewrites them for the merged
compiler in one pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3PPDQti4rghmmPSZGy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants