Repository navigation
Conversation
…cenarios and failing named tests Rows, SPEC.md §31 rows, scenarios, and conformance_<id> tests only; the four tests fail because no case is wired. No implementation, no identity moves. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
#91 stage 4's) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
The reference interpreter, the TargetSemantics denotation, and the SPEC.md 17.14 cost rules charge Expr.value its weight (one for a scalar). The case conformance_tc_08 passes; the 14 fixtures with a literal heavier than one node, their generated statements, and compiler/lexlean.lock are not regenerated, so conformance_tc_01/03/04/05 fail on this tree until the maintainer sequences it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
…-per-thread constant ItemDef::Constant (a thread-local cell and a clone per call) is lowered for a nullary, infallible function whose body is a closed literal with a heap type in rust-std; validate refuses a constant that calls or can fail; the machine reads it as the function it caches. conformance_rb_18 counts allocations under the pinned rustc, with the rebuilding rendering as a plant, and the calculus fixture cached-literal puts a constant in TC-07's differential. rb_01 and rb_07 wait on the maintainer's regeneration of the committed packages and the rust_renderer record. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
|
Generated by Claude Code |
afflom
left a comment
There was a problem hiding this comment.
Maintainer review of RB-18 at ae0d10f. (A comment because the token cannot request changes on its own PR; read it as changes requested.)
Verdict: needs changes. The hoisting itself is right: nullary, infallible, heap-typed, literal body (lower.rs:2382-2405), a thread_local! cell read by an Rc clone so a read allocates nothing, the cached-literal fixture makes the differential and the evaluator agree, and the case is falsifiable (returning the rebuilt literal behind the cell fails at rust_backend.rs:1742 with left: 4 / right: 0). What is wrong is where the construct lives.
Must fix
- The certified machine does not state the crate the renderer writes.
data_b/syntax.rs:611-622encodes aConstantasItemDef.functionwith the literal body, while the printedsrc/lib.rsholdsthread_local!andCELL.with(|cell| cell.clone()), constructsRustSyntax(RustSyntax.lex.tex:284-292:enum,apply,function) does not declare. The PR adds a newItemDeffamily on the Rust side (ast.rs:435) and aCORRESPONDENCErow (validate.rs:1154) and hides both from the machine, then SPEC §17.16 asserts the counted work is unchanged by fiat. That is the opaque-bypass shape R8 forbids, and it is not what the plan on #115 says ("RustSemanticsgains the meaning of the hoisted constant"). Decision: addconstanttoRustSyntaxandRustSemantics(its value is its body's, one tick per read, as planned), have certificate B encode it as itself, and letRustValidatestate its rule (nullary, infallible, literal body) so the bootstrap differential covers it. No printer-only construct; noCORRESPONDENCErow that the machine does not have. - The refusal in the statement is unreachable.
ids.toml:1796promises "a constant whose body calls, or that can fail, is refused before printing", but the only builder of aConstant(lower.rs:2385-2390) never builds one with a call or a fallible result; the refusal is reached only by hand-built ASTs in the test (rust_backend.rs:1776-1796). A gate nothing can reach is not a gate. Once the rule lives inRustValidateper item 1, a committed negative fixture (aconstantwith a call in its body, refused by the validator and by the differential) makes it reachable and the statement stays; if you choose not to, narrow the statement to what is built.
Should fix
VERIFICATION.md:4038-4059: add the command run; quote the observed diagnostic (assertion left == right failed: a read of a cached literal allocates nothing / left: 4 / right: 0atrust_backend.rs:1742) rather than paraphrasing it.- A literal that must not be hoisted has no committed negative case: an ADT-typed nullary literal holding lists is rebuilt per call only because
result.heap()saysAdt(_) => false(ast.rs:150-164). Add the case, and a line in SPEC §17.16 Constants saying ADT-typed literals are not constants. - The RB-18 expectation
"Some(7) 5 5"(rust_backend.rs:1741, 1769) is hand-written; the evaluator/rustc agreement rests onconformance_tc_07'scached-literalfixture, whose committed file does not exist until regeneration. State that in the record. rust-backend.feature:98-101says "read three times"; the test warms once and counts two (rust_backend.rs:1660-1667). Reword one.
Notes (expected on this tree, not findings)
conformance_rb_01 ([constant] row no run package exercises), rb_07 (renderer record), tc_01/03/04/05, and the missing cached-literal fixture file all wait on the landing regeneration. thread_local! passes #[forbid(unsafe_code)] because the std macro is allow_internal_unsafe; the rendered crate compiled with -D warnings.
Generated by Claude Code
…e records of spec/src Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
…mand and the limit of the text check Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
ItemDef.constant in RustSyntax with arms in RustSemantics; certificate B encodes it as itself; the rule (infallible, closed literal, no binding) is stated by validate and by the bootstrap RustValidate, held by five committed crates in the BS-05 differential; the library repairs its one lemma that eliminates ItemDef (findDispatch_some._f). A declared algebraic type is not a constant. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
afflom
left a comment
There was a problem hiding this comment.
Maintainer review, round two, at 4d77480 (read on the stack's head 775bba0).
Verdict: accepted, with should-fixes. Both must-fixes are met. ItemDef.constant [Ident, RustType, Block] is a construct of the machine (RustSyntax.lex.tex:291; RustSemantics.lex.tex:1320 returns it from findFunction as a nullary function and :1346 skips it in dispatch), certificate B encodes it as itself (data_b/syntax.rs:609-619), the rule lives in both validators (validate.rs:771-787; RustValidate.lex.tex DConstant/constantShape/literalOk/noLets, correspondence row last, matching validate.rs:1343), and the refusal is reachable: constant_crates() (rust_validate.rs:1908-1965) refuses a call, a fallible result and a binding in both validators, and a planted constantShape that accepts a fallible result fires conformance_bs_05 at rust_validate.rs:2693 on the rendered leg. The printer plant still fires rb_18 at rust_backend.rs:1742.
On "one tick per read": the Rust machine has no cost component (ROutcome at RustSemantics.lex.tex:9-17; invoke/finished discard the steps), so the tick exists in the calculus (weight v, TC-08) and in the differential's counted work (TC-07), and §17.16 says so. Accepted as written.
Should fix (ride the next push)
- Stale counts:
VERIFICATION.md:9809(BS-05 record) still says "34 hand-built crates … 406 vectors (165 refused) … 675 in all" next to the restated "388 + 246";SPEC.md:7520(§17.23) still says "97 rows of the correspondence table" (now 98). Both must match the register row's restatement (SPEC.md:7536-7538). - The RB-18 scenario (
rust-backend.feature:100-101) promises "validated by the oracle and by the bootstrap validator" and "certificate B states the constant", butcached_literal()(rust_backend.rs:1706-1836) runs neither, and no case asserts certificate B's encoding:artifacts_as_data()countsItemDef::Constantin the crate (preservation.rs:5310-5318) and compiles the certificates, which also compile ifsyntax.rsregressed to the round-one shape. Add one assertion that a certificate B text for a constant containsItemDef.constant(insp_24, where the ten constants are counted, or inrb_18through thedata_bwriter), and point the Then clause at BS-05/SP-24 for the validator half. VERIFICATION.md:4058-4064, plant 2: quote the observed assertion line (assertion left == right failed: a read of a cached literal allocates nothing / left: 4 / right: 0atrust_backend.rs:1742) rather than paraphrasing it.
Notes
Expected on this head, not findings: rb_01, rb_07, tc_01/03/04/05, tc_07's cached-literal fixture file, bs_05's package comparison, the three locks, and every case that compiles the shipped library (sp_13, the Lean SP cases): the committed RustSyntax.lean/RustSemantics.lean lack constant while the committed library repair (findDispatch_some._f) needs it. The regeneration at landing closes that gap. The library diff of the stack is +498/−83 in RustMatches.lex.tex, all from this PR's term-table re-serialisation; no Corr change.
Generated by Claude Code
…alue v (weight v)) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
…rust-constant # Conflicts: # VERIFICATION.md
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
…ted, Then clause points at BS-05 and SP-24 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
|
Round-two should-fixes, head
Gates: fmt, clippy Generated by Claude Code |
…rojection Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
…ojection) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
…PEC.md is their projection) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
…and MD IDs (RP-11) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
… has 446 IDs Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ
|
Maintainer: closed as a stacked draft whose commits are contained in #239 ( Generated by Claude Code |
Part of #115 (L3.2 of #106), PR 3 of the stack, round two after the review. Stacked on #230 (→ #228); merged with
release/v0.5at 42ce948.Change (as reviewed). A function of no parameters that cannot fail, whose body is a closed literal of a list, string or byte string, is a constant in
rust-std: athread_local!cell evaluated once per thread, each call a clone (lower.rs,ast.rs). SPEC §17.16 Constants, RB-18 row (a record inspec/src/IdsRB.lex.tex), scenario.Round two (the review's decision, R8). The constant is a construct of the certified machine, not a printer-only item:
compiler/src/RustSyntax.lex.tex:ItemDef.constant [Ident, RustType, Block];RustSemantics.lex.tex: an arm infindFunction(a constant is a function of no parameters whose body is the value) and infindDispatch. The machine counts no work, so there is no tick to add: "one tick per read" is read as the differentials' counted work, which a clone leaves unchanged; say if you want it elsewhere.data_b/syntax.rs→ItemDef.constant); thefunction()view indata_b.rsis only a lookup.validate.rsand inbootstrap/src/RustValidate.lex.tex(Def.DConstant,literalOk,noLets,constantShape; theconstantcorrespondence row is in both tables, last). Five committed crates in the BS-05 differential (constant_crates: a literal accepted; a call, a failing result, a binding refused; a name declared twice) make the refusal reachable; both validators give the same message, andBS-05counts are now 411/169 and 388 evaluator vectors (restated in SPEC §17.23, the register row, the scenario and VERIFICATION).Type::heap); the case requires it and SPEC §17.16 says so.ItemDefthe library refused atfindDispatch_some._f(the break the [v0.4] #27 stage 6: complete the closed Rust AST so the runtime is generated from the calculus #91 walk predicted); onecasesOnminor repaired (thefunctionminor without its parameters),conformance_sp_13passes over the regenerated machine modules (299 s), no other declaration changed. Method and numbers inVERIFICATION.md.Some(7) 5 5and its dependence on the not-yet-committedcached-literalfixture stated, scenario reworded ("read once to warm, then twice").Gates on the unregenerated tree. fmt, clippy
-D warnings,validate-model(438 ids),validate-spec-links,--test bdd,conformance_rb_18. With the regeneratedRustSyntax/RustSemanticsheld in the working tree only (not committed):conformance_sp_13(library, 299 s),lexlean verifyinbootstrap/(verified 6 modules), andconformance_bs_05through the whole differential (rustc agreement on every vector including the constant crates, planted defects detected) up to the final comparison with the committed packages.Wait for the regeneration (yours).
conformance_rb_01([constant]row no committed package exercises),rb_07(renderer record),conformance_bs_05atpackages/rust-std/audit_tokens/package.json differs from the committed package, the committedlanguage/preservation-1.2/modules/LexLeanTarget/RustSyntax.lean/RustSemantics.lean(the library repair is only valid against them),bootstrap/lexlean.lockand the bootstrap expected records,compiler/lexlean.lock, thecached-literalfixture file, and everything listed on #230.Not established. The certified package for
RustValidate(the production export) after the new definitions: its axiom policies verified (verified 6 modules) but the export is not compared. No fulljust vv.conformance_sp_24is #239's.🤖 Generated with Claude Code
https://claude.ai/code/session_01NZLb4yopYgjBGQngfSuFeQ