Repository navigation
CL-25: lexlean check on wasm32-wasip1 (#494) - #503
Conversation
WASI has no threads, no file lock and no processes, so check runs there with each boundary stated in SPEC.md §8.3 and native code unchanged: - File identity on WASI is the device and inode of WASI stat, read through rustix; a module with two names of one file is still LLC0104. fs4 and same-file are dependencies of the other targets only. - acquire_lock refuses with LLV7010 on WASI before touching the project, so only check (which takes no lock) runs there. - check_project runs on the one stack, and the executable is linked with config::WASI_STACK_BYTES (80 MiB), which build.rs links and the depth plan caps with, so deep input is LLS8002 at a hosted depth of 1,024, not a trap. - embedded_digest reads on the calling thread when no worker can be had. - lifeline has an end_leader for WASI that reports failure. conformance_cl_25 builds the target and compares it with lexlean::cli::run under Node's node:wasi on every single-step check fixture and every example (277 projects), a hard-linked module, a refused fmt, and nesting 1,000 and 1,040. Register 493 -> 494; VERIFICATION.md records the run and a planted defect (no linked stack) that the depth vector catches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
afflom
left a comment
There was a problem hiding this comment.
Bounded review at5f88a303. Engineering direction: retain the narrowly specified WASI checker with mutating/certifying operations refused; do not infer a private filesystem or single writer. Keep the present CL case in rest until actual scheduling evidence warrants another partition. The explicit80MiB linked-stack/host-depth contract can be reviewed as stated; no new benchmark or smaller-stack experiment is requested. Full/native proof obligations and exact future WASI variant qualification remain unchanged.
P2 — init misses the early-refusal boundary. CLI Init reaches init_project; around cli.rs904 it creates the destination, and write_skeleton writes project files before Engine::lock reaches the WASI LLV7010 refusal. Cleanup after the error does not satisfy the promised refusal before touching the project. Put the capability refusal before creation/writes and cover this entry point alongside fmt, reusing the same built WASI binary.
P2 — Coordinate the claim ID. Existing #439 head15c667 reserves CL-25 for lexlean snapshot. #503 uses CL-25 for WASI. Reconcile one unique allocation and its register/scenario/test/spec references with that owner before the release lines meet; account authorship does not make the reservation free.
Concrete overhead reduction: .github/workflows/ci.yml adds the WASI target unconditionally to every vv matrix leg, although this case runs only in rest. Condition that existing install step on matrix.part == 'rest'. This removes demonstrated unrelated installations while retaining honesty dependencies and complete test coverage; no extra BDD partition is needed for that correction.
The inspected WASI stat identity check, typed lock refusal and native/default paths remain; digest spawn failure now falls back on the calling thread on native too, so qualify the body's 'unchanged' wording for that resource-failure behavior. No concrete digest error was demonstrated. Existing owner retains implementation and qualification. No local build, runtime, log or producer was repeated; neither #494 nor this draft is complete.
The case cleared Node's whole environment, PATH included, so a runner
whose node is found only through PATH could not start it. The WASI
program's own environment is still empty (host.mjs passes env: {}).
The README's capability row names CL-01..CL-25 and check on
wasm32-wasip1, as RP-11 requires of the register's last CL ID.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The register is 497 IDs (496 on the line + CL-25): §31's total, RP-07's two checks and the README line follow; CONFORMANCE.md and ERRORS.md are rewritten by validate-model --write. Cargo.toml and build.rs keep both the WASI target dependencies and stack link argument and the line's rustc-address build dependency and production-data feature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Brings in #535 (Intel macOS on the line). The only conflict was the Unreleased CHANGELOG list; both entries are kept. #535 adds no register IDs, so the count stays 497. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
Keep both MAX_COMPILE_STACK_BYTES definitions from #503 (native and WASI) at the crate visibility this PR needs for on_stack callers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Asa3M8ULnzEQwLLngyBBX
|
Post-landing audit: actual4f4c684d has a different tree from final proposal0fd089b7, with two incoming #536 paths. Proposal43670404538 finished64 successful jobs/764 successful steps and3 skipped Intel obligations; exact proposal reproducibility passed. Actual43686612111 remains pending, while actual reproducibility43686612035 passed all seven steps. These receipts do not establish full premerge or actual-tree acceptance under the standing instruction. Final-source disposition now confirms all four earlier findings remain at0fd089b7 and actual4f4c (relevant blobs unchanged into the landing):
Independent final-source receipt ff07e702706d715914bdff305b63c428b669311c7f402ef01b81fe90a2b4ca53 reuses the completed actual audit e9fc1f9a; no gates/logs/producers were repeated. Existing owner retains the corrective batch and qualification. #494 remains open. No skipped/canceled aggregation, retrospective approval, retry, CI control or stopped-runtime adoption. |
…#535, #536) into the arrays branch The generated outputs that both sides rewrote take release/v0.4's copy, or are removed where the line no longer has them; regenerate.yml rewrites the whole set from this tree. Lean moves to 4.32.2 with #518, so the array authority follows the other Lean rows: LEAN-ARRAY-4-32-1 becomes LEAN-ARRAY-4-32-2, cited at f3b06c705e6c. The three files its statement rests on (src/include/lean/lean.h, src/Init/Prelude.lean, src/Init/Data/Array/Set.lean) are byte-identical at f054605aea4b and f3b06c705e6c, so the statement carries over unchanged. runtime-1.2/library.toml keeps the line's toolchain and the branch's Arrays module. LANGUAGE_1_2_SEMANTICS_ID is the merged tree's, as RP-10 recomputes it. CHANGELOG and VERIFICATION keep both sides' entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #494.
Draft proposal. It answers the scope review on #494 by fixing each boundary in SPEC.md before any scope is chosen. The 0.3.0 demonstration is not evidence here; everything below was measured on
release/v0.4at465b8ab00. Native behavior and native error guarantees are unchanged.The boundaries (SPEC.md §8.3, new paragraph;
CL-25)target_family = "wasm"implies nothing about the hosttarget_os = "wasi". The claim nameswasm32-wasip1andcheckonly.LLC0104must not be droppedstatreports, read throughrustix(already a shipped dependency, safe API).same-filerefuses every path there, so it andfs4become non-WASI dependencies. A hard-linked module isLLC0104on both hosts.acquire_lockrefuses withLLV7010before it touches the project. That refuseslock,fmt,build,verifyandmigrate.checktakes no lock.LLS8002config::WASI_STACK_BYTES). That one constant is whatbuild.rslinks with (-zstack-size) and whatcompile_stack_plancaps the hosted depth with. The hosted depth on WASI is 1,024, and deeper input isLLS8002naming both bounds. Stated host requirement: an engine call stack at least Node 22's default. An embedder that links the library into its own module links at leastWASI_STACK_BYTES.check. Verification and production stay native, and are refused on WASI before they start.What changed, site by site
crates/lexlean/Cargo.tomlfs4andsame-fileforcfg(not(target_os = "wasi"));rustixwithfsfor WASI.api.rsacquire_lockLLV7010. The native definition is byte for byte as before.project.rsall_modulesfile_identity:same_file::Handlenatively,(st_dev, st_ino)on WASI.link.rscheck_projectcheck_project_inlineon the one stack. The native thread path is unchanged.config.rs,wasi_stack.rs,build.rsMAX_COMPILE_STACK_BYTESisWASI_STACK_BYTESon WASI, andbuild.rslinks the executable with it.lib.rsembedded_digestidentity_bytesalready does. No target gate. Natively every spawn succeeds as before, and the rows and the digest are the same.verify/lifeline.rsend_leaderfor WASI that reports failure. No process is ever started there.backend/core.rson_stack_forLLS8002.The 0.3.0 patch's other site is not needed any more. Register: 493 → 494 (§31,
model/ids.toml, RP-07 counts, README). §8.5 roles name the WASI split. The CHANGELOG entry and the VERIFICATION.md record are included.The test (
conformance_cl_25)It builds
lexleanforwasm32-wasip1from the tree (release profile), runs it under Node'snode:wasiover the real file system, and compares it withlexlean::cli::runas the fixture runner calls it:checkfixture of §28.2 with no toolchain, overlay or environment of its own, and every example: same exit code, same stdout and stderr, byte for byte;LLC0104on both builds, identical output;fmton WASI: exit 3,LLV7010, project unchanged;max_scope_depth = 100000000with nesting 1,000 (identical to native) and 1,040 (LLS8002, exit 4, on WASI).On the normative host a missing
nodeor a missing target standard library fails the case. Elsewhere the case says it did not run. CI'svvlegs add the target withrustup target add wasm32-wasip1;rust-toolchain.tomlis untouched, because the export custody records its bytes. The case stays in therestremainder. On a shared 12-core host it cost the release wasm build (15 to 20 min; release here is thin LTO and one codegen unit) plus 435 s for the case; a part of its own would need rows inbdd-parts.json,vv-rows.jsonandintel-host-lanes.json, which is the maintainers' call.Node 22 collects garbage inside its fast call of WASI
path_filestat_getand dies with SIGSEGV on language-1.2 projects (backtrace:uvwasi_path_filestat_get→MallocImpl→Heap::CollectGarbage). The host runs with--no-turbo-fast-api-calls, which avoids that call path. This is a Node defect, not a LexLean one.Measured
On Linux x86-64 (WSL Ubuntu, a host shared with other builds), Rust 1.97.1, Node 22.22.2, base
465b8ab00:cargo fmt --all -- --checkcargo xtask validate-modelaudit-shippedincluded)cargo xtask validate-spec-linkscargo clippy --workspace --all-targets --all-features -- -D warningscargo clippy -p lexlean --target wasm32-wasip1 --lib --bins -- -D warnings--all-targetscannot build for WASI: the dev-dependencyproptestpullswait-timeout, which has no WASI implementation)cargo build --release --target wasm32-wasip1 -p lexlean --bin lexleanwasi_snapshot_preview1, initial memory 115 MiB (80 MiB of it the linked stack)conformance_cl_25fmt, and depth vectorscargo test -p lexleanend_children9 of 10:a_signal_the_host_did_not_handle_ends_it_by_defaultfails identically on untouchedrelease/v0.4(465b8ab00) when run the same way. My runs were detached background jobs, which start with SIGQUIT ignored, so its host never receives the default action. Not a defect of either tree; CI runs it in the normal wayLLT4001,LLP2001,LLL1004refusals and passes). About 1.0 to 1.3 s a check under Node, the 1.2 identity computed each process.Planted defect:
build.rswithout the stack link argument.conformance_cl_25still agrees on the 277 projects and then fails atCL-25: nesting 1000 on WASIwithRuntimeError: memory access out of bounds. Restored, it passes. Recorded in VERIFICATION.md.Not tested
just vvwhole. Lean verification,examples,golden,reproand the fullbddwere not run locally (shared machine). CI runs them on this PR.cargo denywith the new WASI-only edge (rustix→libcfor WASI).wasm32-wasip1-threadsandwasm32-wasip2, which this does not claim.For a maintainer
lockbe allowed under a host-declared single-writer contract?LLS8002guarantee.CL-25should get a part of its own.🤖 Generated with Claude Code