// wai-conformance: int-kernels //! `wai.splat.int_codec` — **splat-equivalence**: a LEARNED Gaussian-splat attribute //! codec whose integer synthesis decodes a factorized-rANS latent to the `[14,S,S]` //! attribute tensor byte-identically on every machine, so the reconstructed cloud's //! hash is portable — the int_hyper of 3D. Committed tiny vector under //! `tests/vectors/int_splat/`; never skips. #![cfg(feature = "splat_int")] use std::path::PathBuf; use wai::int_hyper_synth::IntModel; use wai::int_splat::decode; fn dir() -> PathBuf { PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/vectors/int_splat") } #[test] fn decodes_the_learned_splat_cloud_attribute_for_attribute() { // The committed integer model (WHM1) + factorized bitstream decode — no float, no // ML runtime — to the SAME [14,S,S] attribute tensor the Python integer reference // produced. A single disagreeing attribute would diverge this FNV-1a. let gs = IntModel::from_bytes(&std::fs::read(dir().join("splat_gs.bin")).unwrap()).expect("WHM1 g_s"); let text = std::fs::read(dir().join("splat.json")).unwrap(); let bs: serde_json::Value = serde_json::from_slice(&text).unwrap(); let clip = decode(&gs, &text).expect("decode"); assert_eq!(clip.n_attr, bs["attr"].as_u64().unwrap() as usize); assert_eq!(clip.attr.len(), clip.n_attr * clip.s * clip.s, "attribute tensor size"); assert_eq!(clip.s * clip.s, bs["n_gaussians"].as_u64().unwrap() as usize, "N gaussians = S²"); let got = format!("{:016x}", clip.attr_hash()); assert_eq!(got, bs["attr_hash"].as_str().unwrap(), "attributes must reproduce their committed hash"); println!("int_splat: {} gaussians × {} attrs -> attribute-exact, hash {got}", clip.s * clip.s, clip.n_attr); }