Repository navigation
Conversation
GDemay
marked this pull request as ready for review
November 28, 2026 20:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Related to #553. A first-lane read of a proven uniform vector producer can reuse that producer across a direct
s_and_saveexec_b64narrowing in the same block. Both SSA words of the read mask must come from that exact narrowing and both producer mask words must match its input. The preexisting consumer and cycle checks remain in place. Unrelated masks and results that escape the narrowed mask retain their synchronization.Performance
Baseline
27380446e227799438b2c41693426ebb5c5e4420, production candidate618de165f2e7519d8c347845859be3be3034ddda. Apple M5, macOS 27.0 (26A428), CrossOver Wine 11.0, D3DMetal 4.0 beta 3, Rust 1.98.1 Windows gnullvm debug build. Five processes per arm in alternating ABBA order, with the same original shader and benchmark instrumentation on both revisions. Each process discarded three warm-ups and retained twelve samples per group size. At 8,192 groups, individual samples ranged 1.3985–4.7713 ms before and 1.2953–2.4710 ms after. Process medians ranged 1.5973–1.7782 and 1.3675–1.5187 ms respectively. Completion includes queue submission, the recorded readback copy, fence creation, signaling and wait. GPU buffer and pipeline setup, list recording and CPU readback comparison are outside this interval. Game coverage and frame time remain unmeasured.Verification
On the same 32-lane hardware, both builds checked nine separate correctness dispatches of 64 dwords each. The cases cover lower-only, upper-only, both and empty EXEC, an independent requirement for halves, unrelated narrowing and an escaping result. The standalone Wave64 variant was skipped on this Wave32 host. The emission test compares against a same-EXEC control and verifies that the negative cases keep their barriers. Independent review checked the paired SSA comparison and instruction order.
WINEDLLOVERRIDES='d3d12,d3d12core,dxgi=b' VICTORY_REQUIRE_GPU_TESTS=1 \ tools/macos/test-wine.sh --locked -p victory-shader --lib \ a_first_lane_read_under_narrower_exec -- --nocapture --test-threads=1Build the ignored
narrower_exec_completionbenchmark at both revisions with the same test-only fixture and run the already built binaries alone and interleaved. UseVICTORY_NARROW_EXEC_TIMING=1with--ignored --nocapture --test-threads=1. This proof concerns one explicit EXEC narrowing. Fixed code-table proofs in #714, divergent first-lane meetings in #719 and arbitrary LDS sources are separate.To reproduce against the pinned base, copy the benchmark and correctness instrumentation diff from this PR (
crates/victory-shader/src/emit/host.rsandcrates/victory-shader/src/emit/halves_tests.rs) into a base worktree. Leaveemit/lower/first_lane.rsat the base revision. This gives the same instrumentation in both arms. The structural proof assertion intentionally fails on the base.