feat(shader-driver): unbreak with-engine + F32-17D bit-exact qualia tenant (S-series 1+2)#535
Conversation
…ine` engine_bridge.rs:259 used QUALIA_DIMS but line 34 imported only QualiaI4_16D, so `cargo check -p cognitive-shader-driver --features with-engine` failed to compile (the entire dispatch_busdto/unbind_busdto lab surface was dormant). Import QUALIA_DIMS (=17) from the contract; fix two stale `=18` comments (the old padded-18 scheme; the contract is 17). Pure compile fix, no behaviour change. cargo check --features with-engine green; fmt clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CcpLeEC3XK8Eye53GKBVvi
… round-trip exactness
D-CSV-5b made the qualia column i4 (QualiaI4_16D), which clamps to ±1 and
quantizes — silently corrupting the with-engine BusDto round-trip
(codebook_index 42->1, energy 0.1->0.143). 3 round-trip tests had been
dead-and-red (uncompiled while with-engine was broken). The build fix
(commit 1) unmasked them.
Fix (operator-directed F32 tenant; 3-agent panel LAND):
- BindSpace gains `qualia_f32: Box<[QualiaVector]>` ([f32;17]/row),
#[cfg(with-engine)], SINGLETON ONLY (~278KB on 4096 rows). MailboxSoA hot
path stays i4 only — no +68B/row x 64k blowup. NOT a D-CSV-5b reversal: it's
the second tenant (i4 hot + f32 lab), separately-named per the AP1 guard.
- dispatch_busdto writes the f32 tenant alongside the i4 column (i4 stays the
hot-path carrier for general consumers — C7); unbind_busdto reads the f32
tenant (bit-exact). codebook_index rides q[9]-f32 (f32 exact to 2^24,
I-VSA-IDENTITIES register-as-store).
- QUALIA_DIMS import gated to with-engine (no default unused-import).
- The 3 tests pass un-ignored + UNMODIFIED (bit-exact assertions are the spec);
added C8 corner corpus (codebook_index in {0,255,256,1234,4095,65535}).
The F32-17D tenant is the migration's single bit-exact ground-truth to diff
every later step (S3, quantization tiers) against. See E-QUALIA-F32-LAB-TENANT.
Tests: singleton --features with-engine 6/6; mailbox-arm
--features with-engine,mailbox-thoughtspace 5/5 (non-headline top_k=0 loss
preserved, C5/D-DIST-5); default lib 20/20 (cfg field absent). fmt clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CcpLeEC3XK8Eye53GKBVvi
|
Warning Review limit reached
More reviews will be available in 12 minutes and 4 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
S-series Steps 1+2: unbreak
--features with-engine, then restore bit-exact BusDto round-trip via an F32-17D qualia tenant — the single exactness ground-truth the rest of the SoA migration measures against.The bug (latent, unmasked)
engine_bridge::dispatch_busdtostored the BusDto headlinecodebook_indexinq[9]and energies inq[0..9], then quantized throughQualiaI4_16D::from_f32_17d, whichclamp(-1,1)+ i4-rounds. So:codebook_index 42 → 1,1234 → 1(any value ≥ 1 destroyed)energy 0.1 → 0.143(f32to_bitsmismatch)The "round-trips losslessly through f32" doc was stale — true when qualia was an f32 column, false since D-CSV-5b made it i4. The 3 round-trip tests had been dead-and-red (uncompiled while
with-enginewas broken on an unimportedQUALIA_DIMS). Commit 1 unmasks them; commit 2 fixes them.Commits
1 —
fix: import QUALIA_DIMS—engine_bridge.rs:259usedQUALIA_DIMSbut imported onlyQualiaI4_16D, so--features with-enginefailed to compile (the wholedispatch_busdto/unbind_busdtolab surface was dormant). Pure compile fix + two stale=18comments (the contract is 17; this module's localQUALIA_DIMSis the old padded 18).2 —
feat: F32-17D bit-exact qualia tenant(operator-directed; 3-agent panel LAND):BindSpacegainsqualia_f32: Box<[QualiaVector]>([f32;17]/row),#[cfg(with-engine)], singleton only (~278 KB on 4096 rows).MailboxSoAhot path stays i4-only → no+68 B/row × 64kenvelope blowup. NOT a D-CSV-5b reversal — it's the second tenant (i4 hot + f32 lab), separately-named (qualia_f32_row/set_qualia_f32) per the iron-rule AP1 guard; production layout byte-unchanged.dispatch_busdtowrites the f32 tenant alongside the i4 column (i4 stays the hot-path carrier — the±0.15i4-tolerance tests are untouched, C7);unbind_busdtoreads the f32 tenant (bit-exact).codebook_indexridesq[9]-f32 (f32 exact to 2²⁴ ⊇ u16; I-VSA-IDENTITIES register-as-store, no superposition).QUALIA_DIMSimport gated towith-engine(no default-build unused-import).Why F32 (not bf16/f16)
Operator's call: one bit-exact anchor for the whole migration. bf16 is integer-exact only to 256, f16 to 2048, and neither is f32-bit-exact — so neither could satisfy the bit-exact tests as the ground-truth. Alternatives deferred.
Tests
codebook_index ∈ {0,255,256,1234,4095,65535}round-trips bit-exact (pins the255/256nars_f & 0xFFalias boundary + u16 max).--features with-engine(singleton): 6/6--features with-engine,mailbox-thoughtspace(mailbox arm): 5/5 — headline+energy bit-exact via the f32 tenant; non-headlinetop_k=0loss preserved by design (C5/D-DIST-5).Scope notes
CI's clippy gate (style.yml) scopes to
lance-graph-contract/lance-graph/deepnsm— notcognitive-shader-driverorlance-graph-ontology.lance-graph-ontology's 12 pre-existing-D warningsclippy errors (oxrdf/doc-list/to_vec, from #530/#533) are cap-lints-allowed as a dep, not a gate, out of scope. My code introduces no clippy warning.Next (S3): flip
ShaderDriveroff theArc<BindSpace>singleton onto the mailbox set — the F32 tenant is now the bit-exact anchor to diff each step against.🤖 Generated with Claude Code
https://claude.ai/code/session_01CcpLeEC3XK8Eye53GKBVvi
Generated by Claude Code