Repository navigation
Conversation
|
I checked the GPU behavior called out under Not tested on exact head
Tested
Not tested
AI use
|
|
Test run and review of Tested
Review
Not tested: no retail title or regression run (I have no unpacked game), so the 54 programs' behaviour was not seen here; no Run and review by Claude Code (Claude Opus 5.5) on this machine; each point was checked against the code. |
|
Wave64 hardware run, since Not tested lists it:
AI use
|
|
Complementing the RTX 4080 report above with native AMD wave64, an Ampere run, The fixture takes the real Tested
Both old-selection runs produce 64 mismatches out of 128 readbacks with flags
Not tested AI use Synthetic fixture, using existing test helpers (38 lines)#[test]
fn gpu_fssm_wave32_flag_scopes_cross_lane_reads() {
if !gpu_ready() {
return;
}
use crate::gpu::xbox::tests::{fssm, sample};
let code = prog(&[
("V_READFIRSTLANE_B32", "ENC_VOP1", &[("VDST", 8), ("SRC0", V)], None),
("V_READLANE_B32", "ENC_VOP3", &[("VDST", 9), ("SRC0", V), ("SRC1", 159)], None),
("V_MOV_B32", "ENC_VOP1", &[("VDST", 4), ("SRC0", 8)], None),
("V_MOV_B32", "ENC_VOP1", &[("VDST", 5), ("SRC0", 9)], None),
("V_LSHLREV_B32", "ENC_VOP2", &[("VDST", 2), ("SRC0", 131), ("VSRC1", 0)], None),
("V_MOV_B32", "ENC_VOP1", &[("VDST", 3), ("SRC0", 128)], None),
("GLOBAL_STORE_DWORDX2", "ENC_FLAT_GLBL", &[("ADDR", 2), ("DATA", 4), ("SADDR", 0x7D)], None),
]);
assert!(super::detect_wave64(&code), "no EXEC write identifies this as wave32");
for (flags, lanes) in [(0u32, 64usize), (0x20, 32)] {
let mut f = fssm(&code, &[(6, 5)]);
for (offset, value) in [(0xD4, flags), (0x138, 0), (0x13C, 64), (0x140, 1), (0x144, 1)] {
f[offset..offset + 4].copy_from_slice(&value.to_le_bytes());
}
let blob = sample(5, &[f]);
let shader = super::pso::console_to_dxil_in(&blob, super::pso::Stage::Compute, 0, runner::split_wave64(), 1).unwrap();
let out = runner::dispatch(&shader.dxil, [1, 1, 1], &[0; 128], &[0xDEAD_BEEF; 128]).unwrap();
let mut bad = Vec::new();
for tid in 0..64usize {
let first = (tid / lanes * lanes) as u32;
for (component, want) in [(0, first), (1, first + 31)] {
let got = out[tid * 2 + component];
if got != want {
bad.push(format!("thread {tid} component {component}: {got}, want {want}"));
}
}
}
println!("FSSM flags={flags:#x}: 128 cross-lane readbacks checked, {} mismatches", bad.len());
assert!(bad.is_empty(), "flags={flags:#x}: {}", bad.join("; "));
}
} |
towiice
left a comment
There was a problem hiding this comment.
Tested PR head de5b510 on NVIDIA GeForce GTX 1650 SUPER (Turing / TU116, wave32, driver 610.88), Windows 11 build 10.0.26300 (26H2), Rust 1.100.0 (stable-x86_64-pc-windows-gnullvm), DXC v1.9.2609:
cargo test -p xcl --lib gpu::xbox -- --test-threads=4: 10 passed, 0 failed (includinggpu::xbox::tests::wave_size_comes_from_the_header_flag).cargo test -p xcl --test gpu_pso_e2e -- --test-threads=4: 7 passed, 0 failed.
Builds and passes cleanly on Turing / gnullvm.
|
Test report on NVIDIA (wave32-only), commit de5b510 Tested
Not tested
AI use
|
de5b510 to
09b1fb0
Compare
|
Code/CI review only (not independently runtime-tested by me): clean merge and |
09b1fb0 to
500fd5a
Compare
|
Rebased onto AI use: Claude Code (Claude Opus 5.5). |
|
Independent AMD test of both compute backends at Tested
The two synthetic containers held identical compute code with no EXEC writes and varied only the FSSM wave32 flag. All 64 output records per container were checked through the real D3D12 pipeline. Threads 0–31 returned first-lane ID
The compiler counters confirmed 2 direct compute translations and 0 HLSL fallbacks in each direct run. The GPU readback also checked each output's own thread ID. Not tested Retail shaders or titles, graphics and mesh paths, other adapters, or performance. AI use OpenAI Codex (GPT-6 family, exact variant unavailable) adapted the temporary probe, ran the checks, and drafted the report. |
Adapt xcl-dev#573 (500fd5a) with the reviewed header bounds and separate GPU controls. On RTX 5070 the fixture with six wave32 group sizes reproduced an adjacent scalar register overwrite before the fix. Scan-derived programs retain instruction-based wave detection. Assisted-by: Claude Code (Claude Opus 5.5)
500fd5a to
aefabd8
Compare
detect_wave64 tells the wave size from the code: 32-bit EXEC writes and no 64-bit ones mean wave32, anything else wave64. A wave32 program that never writes EXEC has nothing in its code to tell, so it was translated as wave64: its cross-lane reads (v_readfirstlane, v_readlane, permutes) then span 64 threads instead of 32. The FSSM header has the answer: bit 5 of the flags word at +0xD4. Measured on a retail shader pack (26 698 programs): the bit is set for all 2 608 programs the code shows to be wave32 and clear for all 24 036 the code takes for wave64, except 54 compute programs with the bit set and no EXEC write in their code. 27 of those 54 have cross-lane instructions (v_readfirstlane, v_readlane, permutes, LDS). As wave32 all 54 translate completely and compile with DXC. fssm_wave64 takes wave32 from the header and leaves everything else to detect_wave64, so only those programs change. An unused field (0xDEADBEEF) and other FSSM versions say nothing. A compute program through the PSO hook (gpu_compute_e2e) shows the effect: 64 threads store v_readfirstlane of their thread id; with the flag threads 32..63 read thread 32, without it they read thread 0. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
aefabd8 to
b8b4135
Compare
PR #573 — Intel Arc A770 compatibilityTested
Not tested Native wave64, other adapters, graphics stages, other FSSM versions, release builds, the full workspace suite, and retail or main-vs-PR smoke runs. AI use T3 Code / Codex ( |
|
Needs an exact-head AMD GPU verification pass on |
A wave32 console program that never writes EXEC was translated as wave64.
detect_wave64tells the wave size from the code (32-bit EXEC writes and no 64-bit ones mean wave32, anything else wave64), and such a program has nothing in its code to tell. Its cross-lane reads (v_readfirstlane,v_readlane, permutes) then span 64 threads instead of 32.The FSSM header says which it is: bit 5 of the flags word at +0xD4.
fssm_wave64takes wave32 from the header and leaves everything else todetect_wave64, so only those programs change. No issue covers this; I found none fordetect_wave64or the wave size. #517 is adjacent (how wave64 VS / PS are classified for 32-lane GPUs) and touches other functions; the two do not conflict.Measured on a retail shader pack (
XCL_SAMPLE_RPF, 26 698 programs, with a temporary test that is not part of the PR; counts only):maintranslates them as wave64. 27 of them have cross-lane instructions (v_readfirstlane,v_readlane, permutes, LDS);cs_6_6); their HLSL differs from the wave64 translation in all 54 withsplit_wave64(the form 32-lane GPUs get).Where the flag is: the Leonida project's docs (GPL-3.0, no code taken) name this header bit; the numbers above are my own count on the pack with XCL's parser.
What is in it
crates/xcl/src/gpu/xbox.rs:Fssm::wave32(version 0x101, the flags word, an unused 0xDEADBEEF field says nothing), the header comment, and the testwave_size_comes_from_the_header_flag.crates/xcl/src/gpu/recomp/mod.rs:fssm_wave64.crates/xcl/tests/gpu_compute_e2e.rs:console_compute_without_an_exec_write_has_the_wave_size_of_its_header, a compute program through the PSO hook on the GPU: 64 threads storev_readfirstlaneof their thread id. With the flag, threads 32..63 read thread 32; without it they read thread 0.console_cs_flagssets the flags word in the test container.crates/xcl/src/gpu/recomp/pso.rs:console_translationandconsole_meshuse it, and so do the direct DXIL paths from gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 (direct_compute,direct_graphicsand the direct branch ofconsole_mesh), so both backends give an FSSM program the same wave size.crates/xcl/src/shaders.rs: thexcl shaderscompile run that mirrorspso, and its--directpass, use it.xcl shadersstatistics (shaders.rsaddhas only the code).docs/specs/2026-11-20-xcl-design.mdline 340 ("Wave64/wave32 is detected from the code (detect_wave64)") is no longer the whole rule.Tested
stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17 (Windows SDK 10.0.26100.0); tests in debug, title runs in release.cargo build --workspace && cargo test --workspace -- --test-threads=4onb8b4135(rebased onmainbdda528): 1 129 passed, 0 failed, 46 ignored, first run. Earlier heads: 995 / 0 / 45 onaefabd8, 860 / 0 / 42 on500fd5a, 715 / 0 / 41 on09b1fb0.SKIPPEDon this adapter (24 lines): the wave64 GPU tests (no wave64, including the per-lanelower_dxilones and two of its forms the per-lane path refuses),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(the driver cache cannot be disabled without Developer Mode).fssm_wave64returningdetect_wave64(code)alone,wave_size_comes_from_the_header_flagfails (left: (true, true),right: (true, false); run onde5b510), and the GPU test fails atflags 0x20, thread 32(left: (0, 32),right: (32, 32); run on the rebased tree).Regression run
scripts/smoke.ps1, the newer retail title, release builds of both commits, warm shader cache,mainfirst.main:
PR:
Not tested
XCL_DIRECT_DXIL=1on a title (the suite ran, the title run used the default HLSL path).AI use
c160d86,80f4819andbdda528(conflicts inpso.rs), the direct-path changes, the reruns above and these updates. The user asked for the comparison with their earlier Leonida work and approved opening the PR.🤖 Generated with Claude Code