From 7618e72981986800f1a9f0eee7697c621603d76a Mon Sep 17 00:00:00 2001 From: igneum-josh <337424239+igneum-josh@users.noreply.github.com> Date: Thu, 8 Oct 2026 12:41:56 +0100 Subject: [PATCH] igneum-pow: the invention lane's known-failed test for the per-load bias fix (tests/v6_window_bits.rs: the sound form accepts under drawn eras 0 to 7 with 0 window-bit refusals; the no-era bit-0 refusal on seed 3 stands); 2 of 2 on igneum-build-2 at 11:41 UTC against 0ab27582's fix Co-Authored-By: Claude Fable 5.1 --- igneum-pow/tests/v6_window_bits.rs | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 igneum-pow/tests/v6_window_bits.rs diff --git a/igneum-pow/tests/v6_window_bits.rs b/igneum-pow/tests/v6_window_bits.rs new file mode 100644 index 000000000..8c32eddf2 --- /dev/null +++ b/igneum-pow/tests/v6_window_bits.rs @@ -0,0 +1,46 @@ +//! Class v6 invention lane (8 October 2026): the per-load acceptance's value-level bias test must not judge the era +//! window's fixed top index bits. Known-failed first: at counter-asic-4 5984ffab every per-load form under every drawn +//! era was refused with "index bit 26 (or 27) at load site s set in 0 (or 16,384) of 16,384" (0 of 256 seeds on 11 +//! forms, build-1, 11:0x UK); with the window bits skipped the sound form accepts under an era as it does without one. +//! Offered by the invention lane (tools/attack/v6-invention/v6_window_bits.rs.offered on class-v6-invention), landed +//! here by the research lane against 0ab27582's fix. +use igneum_pow::accept::Reject; +use igneum_pow::generator::{attempts_class, LoadClass}; +use igneum_pow::seed::seed_words_from_bytes; + +fn era_class(name: &str, n: u32) -> LoadClass { + let era_seed = seed_words_from_bytes(format!("igneum-era-test/{n}").as_bytes()); + let mut bytes = Vec::new(); + for w in era_seed { + bytes.extend_from_slice(&w.to_le_bytes()); + } + LoadClass::era(LoadClass::parse(name).unwrap(), &bytes, &igneum_pow::generator::V3_ALLOWED) +} + +#[test] +fn per_load_bias_test_skips_the_era_window_bits() { + let mut accepted = 0usize; + let mut window_bit_rejections = 0usize; + for i in 0..8u32 { + let class = era_class("mx8+shl4096x1", i); + let label = format!("igneum-v6inv/{i}"); + for (_, verdict) in attempts_class(&label, label.as_bytes(), class) { + match verdict { + Ok(()) => accepted += 1, + Err(Reject::BiasedIndexBit { bit, ones, .. }) if bit >= 26 && (ones == 0 || ones == 16_384) => window_bit_rejections += 1, + Err(_) => {} + } + } + } + assert_eq!(window_bit_rejections, 0, "a window's fixed top bit was judged as biased"); + assert!(accepted >= 4, "the sound per-load form accepted on {accepted} of 8 seeds under drawn eras (0 before the fix)"); +} + +#[test] +fn per_load_bias_test_still_refuses_a_biased_real_bit_without_an_era() { + let class = LoadClass::parse("mx8+shl4096x1").unwrap(); + let label = "igneum-v6inv/3"; + let v = attempts_class(label, label.as_bytes(), class); + assert!(v.iter().all(|(_, r)| r.is_err()), "seed 3 exhausted the cap on the no-era census (0 of 32) and must still"); + assert!(v.iter().any(|(_, r)| matches!(r, Err(Reject::BiasedIndexBit { bit: 0, .. }))), "a bit-0 refusal on seed 3 stands"); +}