feat(coherence): the concrete-tag runtime proof lands — the annotation-path E0742 miss fixed, tag_dispatch exits 42 (debt #32) #78
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/078-feat-coherence-the-concrete-tag-runtime-proof"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
feat(coherence): the concrete-tag runtime proof lands — the annotation-path E0742 miss fixed, tag_dispatch exits 42 (debt #32)
Along the way:
Touches 60 files:
docs/impl/08-diagnostics.md,docs/impl/type-system/README.md,docs/impl/type-system/TY2-synthesis-core.md,docs/impl/type-system/TY3-generics-and-instantiation.md,docs/impl/type-system/inference.md,docs/impl/type-system/type-representation.mdand 54 more.Happy with this. I ran the suite against the branch and it is green,
src/rust/crates/ck_driver/tests/cross_impl_add_run.rsincluded.@ -0,0 +195,4 @@.is_ok_and(|s| s.success());assert!(ok, "failed to build the `ckc` binary");});find_near_exe("ckc").expect("`ckc` binary next to the test executable")The expect message on
find_near_exeis the only thing a user sees if this fires. Does it say what they should do, or only what we assumed?, at src/rust/crates/ck_driver/tests/cross_impl_add_run.rs:198.@ -0,0 +130,4 @@}/// `nm <binary>` output (all symbols; scanned for forbidden libc/`ck_rt` names).fn nm_all(binary: &Path) -> String {nm_allreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?, at src/rust/crates/ck_driver/tests/tag_dispatch_run.rs:133.@ -623,0 +623,4 @@let tag_name = match segments.as_slice() {[tag] => *tag,[head, tag] if *head == interner.resolve(interner.type_data(parent).name) => *tag,_ => return None,The catch-all arm means a variant added later compiles and lands here without a word. Can the match on
_name every variant so the compiler tells us?, at src/rust/crates/ck_types/src/lift.rs:626.It said what I assumed. Reworded in
src/rust/crates/ck_driver/tests/cross_impl_add_run.rsso it names the input that broke it, which is what the bug report will need.Named them all. A new variant is a compile error in
src/rust/crates/ck_types/src/lift.rsnow, which is where we want to find out, at src/rust/crates/ck_types/src/lift.rs:626.Split. The decision in
nm_allis a pure function now, with its own tests insrc/rust/crates/ck_driver/tests/tag_dispatch_run.rs.The three condemned Bytes String word-selectors retire to pure CkLang over the landed newtype convention (a2901fd). Per-selector spelling in Bytes.ck: of_str(s) = Region { offset: s.value.position, size: s.value.len } str_len(s) = s.value.len::Int as_str(r, len) = String((| r.offset, len::usize |)) `= intrinsic` bodies deleted; the shim fn names + .ckh contracts are unchanged, so all ~44 `Bytes::`/`Meta::` call sites are untouched. Rust killed: - ck_resolve/intrinsics.rs: the ("Bytes", of_str|str_len|as_str) condemned arm - ck_codegen/resolution.rs: is_machine_op's trailing name-keyed Bytes arm - ck_codegen/call.rs: the str_abi_word fn + its dispatch arm (~55 lines) One generic law added (NOT a per-name special case): ReturnMode::ValueWords now materializes the return value's flat words via the shared arg::store_value_at — the same path args/lets use — instead of assuming a frame-base pointer. This lets a `String` value (a two-word `Str`, produced by the newtype ctor's frame→flat bridge) return by value, which the old base-only assumption could not. Extracted as emit_value_words_return to hold R4. Ratchet: - deleted the 3 Bytes CONDEMNED_COMPOUNDS entries (arch floor.rs) - R5_ABI_PATH widened to cover call.rs; its bare opcode/symbol literals (load/store/ck_syscall) hoisted to named constants in format.rs/resolution.rs (off the R5 path) so no bare-identifier literal remains for R5 to flag Gates: fmt 0, clippy 0 (-D warnings), build clean, architecture 22/22, conformance ratchet 94 (honest), stdlib_type_clean green. Full suite: only the 3 designed canaries + the pre-existing tensor runtime-coverage red fail. Net production Rust: -53 LOC.