From b6e0605e63b2948b4ee45f66815ec17c6f807312 Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Thu, 22 Oct 2026 22:34:35 +0200 Subject: [PATCH 1/4] test(lab): test(pal256): loud-signal salience selection and rare-signal falsifier --- .../tests/palette256_salience_probe.rs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 crates/bgz-tensor/tests/palette256_salience_probe.rs diff --git a/crates/bgz-tensor/tests/palette256_salience_probe.rs b/crates/bgz-tensor/tests/palette256_salience_probe.rs new file mode 100644 index 000000000..66d2459a1 --- /dev/null +++ b/crates/bgz-tensor/tests/palette256_salience_probe.rs @@ -0,0 +1,36 @@ +//! Lab-only salience/energy probe: MP3 is an analogy, not a perceptual codec. +//! Never change the immutable trained codebook during inference. +fn top_energy(input: &[f64], k: usize) -> Vec { + let mut rank: Vec = (0..input.len()).collect(); + rank.sort_by(|&a, &b| input[b].abs().total_cmp(&input[a].abs()).then(a.cmp(&b))); + rank.truncate(k.min(rank.len())); + rank +} +fn energy(input: &[f64], keep: &[usize]) -> (f64, f64) { + let total = input.iter().map(|x| x * x).sum::(); + let saved = keep.iter().map(|&i| input[i] * input[i]).sum::(); + (saved, total) +} +#[test] +fn dominant_signal_energy_is_retained_without_retraining_the_reference() { + let features = [8.0, -6.0, 0.10, 0.08, -0.04, 0.02, 0.01, 0.0]; + let before = features; + let selected = top_energy(&features, 2); + assert_eq!(selected, vec![0, 1]); + let (saved, total) = energy(&features, &selected); + assert!(saved / total > 0.999); + assert_eq!(features, before, "salience is a selection, not codebook motion"); +} +#[test] +fn rare_low_amplitude_causal_feature_is_a_counterexample_to_energy_only() { + // This is a deliberate negative control: a small coordinate may determine + // the label even when discarded energy is negligible. + let class_a = [12.0, 9.0, 0.01]; + let class_b = [12.0, 9.0, -0.01]; + let keep_a = top_energy(&class_a, 2); + let keep_b = top_energy(&class_b, 2); + assert_eq!(keep_a, keep_b); + assert!(keep_a.iter().all(|&idx| class_a[idx] == class_b[idx])); + assert_ne!(class_a[2].is_sign_positive(), class_b[2].is_sign_positive()); + // No global claim that loud-only preservation implies semantic correctness. +} From 45884e038c4511dfb274c919f106481c51b390db Mon Sep 17 00:00:00 2001 From: AdaWorldAPI Date: Thu, 22 Oct 2026 22:34:38 +0200 Subject: [PATCH 2/4] test(lab): test(pal256): loud-signal salience selection and rare-signal falsifier --- .../entries/2026-10-22-pal256-salience-mp3-probe.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .claude/board/entries/2026-10-22-pal256-salience-mp3-probe.md diff --git a/.claude/board/entries/2026-10-22-pal256-salience-mp3-probe.md b/.claude/board/entries/2026-10-22-pal256-salience-mp3-probe.md new file mode 100644 index 000000000..4d0850d7b --- /dev/null +++ b/.claude/board/entries/2026-10-22-pal256-salience-mp3-probe.md @@ -0,0 +1,9 @@ +# Palette256 loud-signal / MP3 analogy: measurable salience, not semantic proof + +Status: **test-only / no bake change**. Immutable codebook remains reference; salience is a cold candidate selection policy, not a learned mutation of indices or LUT values. + +Experiment: top-k magnitude keeps almost all squared energy on a heavy-head fixture. **Negative control:** low-energy rare coordinate is the *only* class discriminator. Thus preserved spectral energy != preserved reasoning truth. + +Acceptance for any future corpus bake: declare signal family, norm, salience threshold, protected rare-event strata, held-out top-k recall, calibrated error/abstention and versioned codebook digest. Do not claim psychoacoustic masking is directly transferable to cognition. + +Commands: `cargo test --manifest-path crates/bgz-tensor/Cargo.toml --test palette256_salience_probe`. From 2a7140832139dc8dff3b24b1b7b7e0d78166efa8 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 22 Oct 2026 21:41:52 +0000 Subject: [PATCH 3/4] fix(ci): rustfmt the probe test, regenerate the board entries index Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg --- .claude/board/entries/README.md | 3 ++- crates/bgz-tensor/tests/palette256_salience_probe.rs | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.claude/board/entries/README.md b/.claude/board/entries/README.md index dd6231c6a..50805733a 100644 --- a/.claude/board/entries/README.md +++ b/.claude/board/entries/README.md @@ -25,10 +25,11 @@ index row, (3) no duplicate entry id. Checks 1 and 2 are deliberately opposite directions; the stranding this convention prevents shows up in exactly one of them, never both. -429 entries, 2026-08-06 .. 2026-10-22. +430 entries, 2026-08-06 .. 2026-10-22. | date | entry id | finding | file | |---|---|---|---| +| 2026-10-22 | `pal256-salience-mp3-probe` | | [2026-10-22-pal256-salience-mp3-probe.md](2026-10-22-pal256-salience-mp3-probe.md) | | 2026-10-22 | `math-compiler-stage-b-e1` | | [2026-10-22-math-compiler-stage-b-e1.md](2026-10-22-math-compiler-stage-b-e1.md) | | 2026-10-22 | `math-compiler-gap-matrix` | | [2026-10-22-math-compiler-gap-matrix.md](2026-10-22-math-compiler-gap-matrix.md) | | 2026-10-22 | `D-MPS-9` | | [2026-10-22-d-mps-9-mork-oracle.md](2026-10-22-d-mps-9-mork-oracle.md) | diff --git a/crates/bgz-tensor/tests/palette256_salience_probe.rs b/crates/bgz-tensor/tests/palette256_salience_probe.rs index 66d2459a1..f19a18257 100644 --- a/crates/bgz-tensor/tests/palette256_salience_probe.rs +++ b/crates/bgz-tensor/tests/palette256_salience_probe.rs @@ -19,7 +19,10 @@ fn dominant_signal_energy_is_retained_without_retraining_the_reference() { assert_eq!(selected, vec![0, 1]); let (saved, total) = energy(&features, &selected); assert!(saved / total > 0.999); - assert_eq!(features, before, "salience is a selection, not codebook motion"); + assert_eq!( + features, before, + "salience is a selection, not codebook motion" + ); } #[test] fn rare_low_amplitude_causal_feature_is_a_counterexample_to_energy_only() { From 0ebf85c88dfa3ec47b600923dca3717de2f30a40 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 22 Oct 2026 21:53:44 +0000 Subject: [PATCH 4/4] probe: fold #1718's production-surface test into this series Moves crates/bgz-tensor/tests/palette_immutable_salience_probe.rs here from #1718. Unlike the local helpers already in this series, it exercises the real implementation, so the series keeps its experiment contract and gains the concrete counter-probe. #1718 is closed as superseded once this lands. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01G22yT6htkcdyXsihxxXdrg --- .../tests/palette_immutable_salience_probe.rs | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 crates/bgz-tensor/tests/palette_immutable_salience_probe.rs diff --git a/crates/bgz-tensor/tests/palette_immutable_salience_probe.rs b/crates/bgz-tensor/tests/palette_immutable_salience_probe.rs new file mode 100644 index 000000000..e345a957c --- /dev/null +++ b/crates/bgz-tensor/tests/palette_immutable_salience_probe.rs @@ -0,0 +1,37 @@ +//! Read-only Palette256 frame and PCDVQ salience contract. +//! This does not assert that dropping weak signals eliminates hallucinations. +use bgz_tensor::{Base17, WeightPalette}; + +fn axis(axis: usize, amplitude: i16) -> Base17 { + let mut dims = [0i16; 17]; + dims[axis] = amplitude; + Base17 { dims } +} + +#[test] +fn directional_signal_has_higher_salience_than_same_amplitude_detail() { + let origin = axis(0, 0); + let directional = axis(0, 8); + let detail = axis(16, 8); + assert_eq!(origin.l1(&directional), origin.l1(&detail)); + assert_eq!(origin.l1_weighted(&directional), 20 * 8); + assert_eq!(origin.l1_weighted(&detail), 8); +} + +#[test] +fn inference_reads_do_not_retrain_the_baked_reference() { + let rows = [axis(0, 0), axis(0, 12), axis(16, 2), axis(0, -12)]; + let palette = WeightPalette::build(&rows, 3); + let original_entries = palette.entries.clone(); + let original_radii = palette.radii.clone(); + let original_counts = palette.counts.clone(); + for _ in 0..64 { + for row in &rows { + let assignment = palette.assign(row); + assert!((assignment.index as usize) < palette.len()); + } + } + assert_eq!(palette.entries, original_entries); + assert_eq!(palette.radii, original_radii); + assert_eq!(palette.counts, original_counts); +}