Repository navigation
D3D12-SHADER-1D-WAVE-BASE-NO-TICKET: skip entry ticket barrier and LDS atomic for 1-D groups - #2685
Conversation
|
Checked by OreoFR on macOS 27.2.1, Apple M5, Rust 1.98.1,
AI-assisted: Claude Code |
|
Windows numbers for the part I could not run on macOS, measured by mooneyes-agent (MoonEyes's agent) and relayed here with their OK: Windows 11,
AI-assisted: Claude Code |
…r 1-D groups (D3D12-SHADER-1D-WAVE-BASE-NO-TICKET)
Addresses the d3d12/docs/findings.md item ("the entry ticket of every
console wave64 program with lane code (a group barrier and an LDS
atomic, also for groups of one dimension, where the host's waves are
runs of consecutive ids)").
For 1-D host groups (threads[1] == 1 && threads[2] == 1, including all
multi-wave paired groups which are lowered as [32 * waves, 1, 1]), each
host wave already receives a consecutive run of flat thread IDs. Derive
each wave's console thread base directly from
waveReadLaneFirst(flattenedThreadIdInGroup) & !(wave - 1) (shifted left
by 1 for paired groups) instead of allocating an LDS counter dword and
emitting an entry group_sync + atomicrmw add.
2-D and 3-D groups keep the LDS counter path unchanged.
AI-assisted: Antigravity (Gemini 4 Neon)
15478c9 to
903e373
Compare
|
Independent check on Windows (not the author), at
Environment: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, Rust 1.98.1 pinned. The skipped ticket/barrier path is covered by the crate's own emit tests; I did not independently measure the performance change on a GPU. AI-assisted: yes (opencode). |
Hardware readback on RTX 4070 SUPER and Radeon 610MMEASURED. Tested On each GPU and in all three runs per tree, emitted group barriers went from 2 to 1 in halves mode and 1 to 0 in paired mode. Both modes returned the exact 128 words I also locally merged #2685 and #2688 ( Scope: synthetic hardware dispatch and readback under Wine. Separate Microsoft SDK DXIL validation and gameplay measurements are outside these runs. AI-assisted: Codex (GPT-6.2 Sol). |
|
RUN · VERIFY-2685-RTX4060 · by MoonEyes (another person than the author) on head
AI-assisted (Claude Code). |
|
Merging. Head AI-assisted (Claude Code). |
… 1D wave-base (ProjectLeonida#2685), NaN-exact, by_due texture queue, unlocked pool growth (ProjectLeonida#2693), pipeline wait queue (ProjectLeonida#2622)
Claimed in #2570 as
D3D12-SHADER-1D-WAVE-BASE-NO-TICKET(#issuecomment-7267081456).What and why
Addresses the open shader-performance item in
d3d12/docs/findings.md:In
d3d12/crates/leonida-shader/src/emit/lower.rs, every 1-D wave64/console-lanes compute shader (including multi-wave paired shaders, whose host group shape is always[32 * waves, 1, 1]) previously allocated an LDS counter dword and emitted an entrygroup_sync+atomicrmw addunless its LDS was already full (>= 8192dwords).Because 1-D host groups already assign each host wave a consecutive run of
flattenedThreadIdInGroupvalues:[32 * waves, 1, 1]): sethalves = Some(NO_COUNTER)and computebase = (waveReadLaneFirst(flat_id) & !31) << 1inconsole_thread().cs.threads[1] == 1 && cs.threads[2] == 1): usehalves = Some(NO_COUNTER)/ skipticket, using the existing flat-IDconsole_thread()path (also settingflags::WAVE_OPS).Verification (Red -> Green)
Hardware / OS: native Windows 11 Pro (
10.0.26200) + AMD Radeon RX 7900 XTX (gfx1100, driver32.0.32029.2010), pinned toolchainrustc 1.98.1.one_d_wave64_group_skips_entry_ticket_barrier_and_keeps_thread_idson[128, 1, 1]emitted2group barriers in halves mode (entry ticket +v_mbcntexchange) and1in paired mode (entry ticket).main40e7fe69d):1barrier (entry ticket eliminated); paired mode drops to0barriers; DXIL validated; GPU dispatch verified all 128 console thread IDs[1..=128]exact.cargo test -p leonida-shader --lib wave64_tests -- --test-threads=4—31 passed; 0 failed(3.81s, including all 2D/3D group tests).cargo test -p leonida-shader --lib paired_tests -- --test-threads=4—16 passed; 0 failed(7.56s).python -I scripts/check_no_game_data.pyon both touched files — PASS.AI-assisted: Antigravity (Gemini 4 Neon)