Skip to content

GN-10: hold Target's instruction price to the target - #542

Draft
afflom wants to merge 4 commits into
release/v0.5from
claude/119-gn-10-target-price
Draft

afflom wants to merge 4 commits into
release/v0.5from
claude/119-gn-10-target-price

Conversation

@afflom

@afflom afflom commented Nov 14, 2026

Copy link
Copy Markdown
Member

Part of #119.

  • Registers GN-10. LexLeanStd.Target gets a production root, instructionPrice (rust-std, effect overflow), which reads price by instruction code.
  • The pinned rustc compiles each intrinsic under #[target_feature] to assembly, and each one must come out as exactly one instruction whose source registers hold the bytes the module charges.
  • The lanes of the first operand that the result depends on must equal the lanes charged per instruction. This is checked under the evaluator, and also under the real instruction on hosts that can run it. Planted lane and byte counts are detected.
  • This check found an error in the module: i16x8_extmul_low_i8x16 multiplies only its low 8 lanes, so it is now charged one instruction per 8 lanes instead of 16.
  • Kernel functions are #[inline(never)], because otherwise rustc emits no code for some of them on AArch64. The wasm32 functions use the C ABI so that a v128 is passed as a value; with the Rust ABI, LLVM rewrote extmul into two load8x8_s loads and an i16x8.mul.
  • Local runs: GN-09 and GN-10 pass, and validate-model and check-calculus are clean. The std tree identity moves, so the locks and golden outputs are left to the regenerate workflow.

Generated by Claude Code

A production root `instructionPrice` reads `price` by instruction code.
GN-10 compiles each modeled intrinsic with the pinned rustc to assembly,
where it is exactly one instruction whose source registers hold the bytes
the module charges, and checks that the lanes of the first operand the
result depends on (under the evaluator, and under the instruction where the
host executes it) are the lanes charged per instruction. The oracle corrects
`i16x8_extmul_low_i8x16`: it multiplies only its low eight lanes, so it is
charged one instruction per eight lanes, not sixteen.

The kernel functions are `#[inline(never)]`, since rustc otherwise emits no
code for small cross-crate-inlinable leaves (seen on AArch64), and the
wasm32 ones use the C ABI so a `v128` is a value rather than memory LLVM
folds into widening loads.

Generated outputs (locks pinning the std tree, golden) are left to the
regenerate workflow.

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

afflom commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Producer coordination: live GitHub shows two regenerate pushes for exact e09c6b9:43645654811 on regenerate/119-gn-10 is in progress, and43646129802 on regenerate/gn10-542 is queued. Please bind the sole execution owner and disposition the second request before it becomes duplicate work. If these are intentionally separate parts of one wave, retain their disjoint recipe/output scopes and custody explicitly; the shared head alone does not establish that.

Reuse the valid first run's outputs/results where applicable and preserve all failed/successful receipts. #541 also has its own active regeneration43644952249, so coordinate identity-changing adoption serially. Root launched no producer, retry or CI-control action, and is not approving simultaneous identity waves or adopting stopped#431 scope.

afflom commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

I've cancelled 43646129802 (regenerate/gn10-542). It duplicated the regeneration already running, so 43645654811 (regenerate/119-gn-10) is now the only one for e09c6b9. Identity adoption still happens one PR at a time, after #541.


Generated by Claude Code

@afflom afflom mentioned this pull request Nov 14, 2026
github-actions Bot and others added 2 commits November 15, 2026 00:20
The write recipes of SPEC.md §9.2, run by regenerate.yml (https://github.com/UOR-Foundation/lexlean/actions/runs/43648031151),
rewrote 884 paths.

The counts writer reported:

    BS-07 VECTORS: 410 -> 411 (crates/conformance/src/cases/bootstrap/rust_lower.rs)
    BS-07 VECTORS_WITHIN: 308 -> 309 (crates/conformance/src/cases/bootstrap/rust_lower.rs)
    BS-11 EVALUATOR_MUTANTS: 275 -> 269 (crates/conformance/src/cases/bootstrap/rust_bodies.rs)
    BS-12 EVALUATOR_MUTANTS: 154 -> 166 (crates/conformance/src/cases/bootstrap/rust_succeed.rs)
    BS-12 VECTORS: 84 -> 85 (crates/conformance/src/cases/bootstrap/rust_succeed.rs)
    BS-12 VECTORS_WITHIN: 82 -> 83 (crates/conformance/src/cases/bootstrap/rust_succeed.rs)
    BS-13 EVALUATOR_MUTANTS: 136 -> 129 (crates/conformance/src/cases/bootstrap/rust_loops.rs)
    BS-14 EVALUATOR_MUTANTS: 551 -> 575 (crates/conformance/src/cases/bootstrap/rust_assemble.rs)
    BS-14 VECTORS: 414 -> 415 (crates/conformance/src/cases/bootstrap/rust_assemble.rs)
    BS-14 VECTORS_WITHIN: 312 -> 313 (crates/conformance/src/cases/bootstrap/rust_assemble.rs)
    BS-07: §31 row: 308 -> 309 (x1), 410 -> 411 (x1)
    BS-07: register: 308 -> 309 (x1), 410 -> 411 (x1)
    BS-07: scenario: 308 -> 309 (x1), 410 -> 411 (x1)
    BS-11: §31 row: 275 -> 269 (x1)
    BS-11: register: 275 -> 269 (x1)
    BS-11: scenario: 275 -> 269 (x1)
    BS-12: §31 row: 84 -> 85 (x1), 154 -> 166 (x1)
    BS-12: the §31 row does not state 82 (-> 83)
    BS-12: register: 84 -> 85 (x1), 154 -> 166 (x1)
    BS-12: scenario: 84 -> 85 (x1), 154 -> 166 (x1)
    BS-13: §31 row: 136 -> 129 (x1)
    BS-13: register: 136 -> 129 (x1)
    BS-13: scenario: 136 -> 129 (x1)
    BS-14: §31 row: 414 -> 415 (x1), 551 -> 575 (x1)
    BS-14: the §31 row does not state 312 (-> 313)
    BS-14: register: 414 -> 415 (x1), 551 -> 575 (x1)
    BS-14: scenario: 414 -> 415 (x1), 551 -> 575 (x1)
    SPEC.md:8857: 275 -> 269 (every holder)
    SPEC.md:8852: 82 -> 83 (every holder)
    SPEC.md:8743: 154 -> 166 (BS-12)
    SPEC.md:8743: 308 -> 309 (every holder)

    VERIFICATION.md rows for the landing (counts | before | after):
    | `BS-07` VECTORS, VECTORS_WITHIN | 410, 308 | 411, 309 |
    | `BS-11` EVALUATOR_MUTANTS | 275 | 269 |
    | `BS-12` EVALUATOR_MUTANTS, VECTORS, VECTORS_WITHIN | 154, 84, 82 | 166, 85, 83 |
    | `BS-13` EVALUATOR_MUTANTS | 136 | 129 |
    | `BS-14` EVALUATOR_MUTANTS, VECTORS, VECTORS_WITHIN | 551, 414, 312 | 575, 415, 313 |

    For a reader:
      SPEC.md:8568 still states 410 (-> 411 for BS-07?) before "of `correspondCrate` (103 refused), and"
      SPEC.md:8740 still states 410 (-> 411 for BS-07?) before "per root: the committed target programs"
    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

This branch has not been deployed

No deployments
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.

1 participant