class-v6: the window-text test counts OpenCL's shuffle blocks as statements

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
igneum-labs 2026-10-08 16:15:49 +00:00
parent bf584f8145
commit 0cc27b0cac

View file

@ -1112,13 +1112,12 @@ fn reg64_cpu_verifier_and_cuda_text_agree() {
let terms: Vec<String> = (k + 8..64).step_by(8).map(|j| format!("r{j}")).collect();
assert!(text.contains(&format!(" r{k} = r{k} ^ {};\n", terms.join(" ^ "))), "{name}: the fold of r{k}");
}
let per_kernel = if name.ends_with(".metal") { 1 } else { 1 };
let _ = per_kernel;
let lines: Vec<&str> = text.lines().filter(|l| l.starts_with(" r") && l.contains(" // ")).collect();
// a statement line opens with its register, or with the shuffle's block in OpenCL ("{ uint t_; ...")
let lines: Vec<&str> = text.lines().filter(|l| (l.starts_with(" r") || l.starts_with(" { uint t_;")) && l.contains(" // ")).collect();
assert!(lines.len() % 128 == 0 && !lines.is_empty(), "{name}: {} statement lines, a multiple of 128", lines.len());
for (k, (line, ins)) in lines.iter().take(128).zip(sched.iter()).enumerate() {
let stmt = line.trim_start();
assert!(stmt.starts_with(&format!("r{} = ", ins.dst)) || stmt.starts_with("{ uint t_;"), "{name} statement {k}: dst r{}: {stmt}", ins.dst);
assert!(stmt.starts_with(&format!("r{} = ", ins.dst)) || (stmt.starts_with("{ uint t_;") && stmt.contains(&format!("r{} = r{} ^ t_", ins.dst, ins.dst))), "{name} statement {k}: dst r{}: {stmt}", ins.dst);
}
assert_eq!(text.matches("rotl_imm(").count() >= 2 * LOAD_SLOTS, true, "{name}: the era loads");
}