feat(corpus): word-grain count walk — the grain payoff, pure CkLang, x2.72 #71
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/071-feat-corpus-word-grain-count-walk-the-grain-pa"
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(corpus): word-grain count walk — the grain payoff, pure CkLang, x2.72
Along the way:
Touches 127 files:
Floor.ck,Prelude.ck,handoff.md,plan.md,scripts/test.sh,slice_turbofish.mdand 121 more.Reads well. One question on
src/rust/crates/ck_driver/tests/primes_actor_garage_bitwise_v4_run.rs, nothing blocking.@ -0,0 +219,4 @@}/// The corpus app directory `<repo>/tests/corpus/<name>`.fn corpus_app(name: &str) -> PathBuf {corpus_appreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?Split. The decision in
corpus_appis a pure function now, with its own tests insrc/rust/crates/ck_driver/tests/primes_actor_garage_bitwise_v4_run.rs.Second read on
src/rust/crates/ck_driver/tests/primes_actor_garage_bitwise_v4_run.rs. Nothing to add.Two new drag-race siblings, both pure CkLang over existing leaves — zero compiler change — each isolating one SOURCE decision, measured pinned (P-core, docker cpuset 4, --opt speed, 5 s races, every pass 78,498-validated): - primes_actor_garage_bitwise_v4 — ALLOCATION LIFETIME: the flag region is `Alloc::os_acquire`d once in `spawn` and recycled every pass by an in-place word-grain clear (7,812 store::<u64>s, four per iteration — zero per-pass kernel crossings); the strike computes its byte handle once per strike with a strength-reduced bit-space cursor (`b += f` replaces `j += 2f` + a per-strike shift); the count walk takes two words per iteration into two independent partial sums. 9,736 -> 11,585 passes/5 s vs v3 (x1.19). Two measured REJECTS recorded in the header: register-aggregated strikes (7,576 — a serial accumulator chain loses to independent byte RMWs the OOO core overlaps) and L1 segmentation (no gain — the walk is not L1-miss bound). Same `algorithm=base,faithful=yes,bits=1` line as its siblings. - primes_actor_garage_wheel_v1 — ALGORITHM CLASS, honestly tagged `algorithm=wheel`: a wheel-30 sieve on the v4 chassis. Multiples of 2/3/5 never exist in the bitmap (one bit per residue of {1,7,11,13,17,19,23,29} mod 30, one byte per 30 numbers, 33,334 live bytes as whole words), sieving starts at f = 7, and each prime's walk unrolls its 8 multiplier residue classes — 8 independent byte RMWs + 8 register adds per wheel turn, exact single-strike epilogues per class. `/30` and `%30` are a magic-constant multiply-shift; the wheel's shape is DATA (a 64-byte table region filled once in `spawn`), not compiler machinery. 54,152 passes/5 s vs v4's 11,571 on the same binary (x4.68). Validator counts 2/3/5 back in; negative-tested (a wrong count formula crashes on pass one, no score posts). Both gates follow the sibling pattern verbatim (crash-or-clean exit 0, well-formed line, freestanding ELF checks), are registered in `RUNTIME_TESTED`, and are born into the manual-only garage tier (`#[ignore]`, `./scripts/test.sh --garage`; owner decision 2026-07-18). v4's source is on the post-a11c1bd two-surface coercion form (`x::u64` letter coercions, turbofish kept on genuine specializations). Gates: fmt 0 / clippy -D warnings 0 / default suite green (~19 s) / garage tier green (all six races, ~31 s).