Repository navigation
Shaders: lane masks read through a join need the console's wave size; tests skip devices without 32-lane waves (#356) - #377
Open
RenzoWit35 wants to merge 2 commits into
Conversation
…he other is a mask read as data, so the program declares the console's wave size (fxceless#356) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, on a device without 32-lane waves (fxceless#356) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Addresses two of the three causes behind the six failures in #356. Those failures come from a host whose waves are not 32 lanes wide; the reported numbers point to 16-lane waves.
What changed
1. A lane mask that reaches data through a join now requires the console's wave size (
d0602c7)reads_mask_as_dataonly counted a value as a mask when that value itself was a known mask. Ina_lane_mask_joined_with_a_number_is_read_as_the_number_it_is,s20holdsvcc_loon one path and5on the other. After the join it is a phi, which the check did not count, so the program declared noWaveSize. On a 32-lane host that goes unnoticed. On a 16-lane host the ballot covers 16 lanes, which is the65535vs4294967295in the report.The new
mask_values(inemit/lower.rs) adds every phi that has a mask among its incoming values, directly or through other phis.reads_mask_as_datatakes that set, computed once per program, in both the lowering andown_bits. Instructions whose result is a mask still don't count as data reads.New GPU-free test: the program above must lower with
wave_size == Some(32). It fails with the old check.2. Shader tests skip, rather than fail, a
WaveSize(32)program on a device without 32-lane waves (23b63af)Host::wave_lanes()readsWaveLaneCountMin/Max(D3D12 OPTIONS1), andHost::runs_waves_of(n)checks n against that range.run_cases_onnow skips a refused pipeline only when the device cannot run 32-lane waves; on any other device a refused pipeline still panics. This coversds_min_max_f32_order_floats_and_return_the_old_value("compute_pipeline failed: The parameter is incorrect" in #356).on_the_cardinwave64_testsalready skipped refused pipelines.New test
devices_report_their_wave_sizeschecks that each device reports a power-of-two range.Testing
cargo test --workspacepasses on an RTX 4070 Ti (32–32 lanes), andcargo clippy --workspace --all-targetsis clean.WaveSize(32)with the same error as in 6 tests failed during cargo test --workspace.test result: FAILED. 204 passed; 6 failed; 2 ignored; 0 measured; 0 filtered out; finished in 6.90s#356. With WARP added temporarily to theds_min_maxorder test, the WARP run is now skipped with a message instead of failing.For reviewers
WaveSize(32). On NVIDIA (host_max_wave() == 32), some console wave64 programs may move to the exchange path or keep 64-lane waves and be refused. Avictory translaterun on the title's shaders before and after this branch would show the change; I had no game files configured to run it.*_node_test_*failures in 6 tests failed during cargo test --workspace.test result: FAILED. 204 passed; 6 failed; 2 ignored; 0 measured; 0 filtered out; finished in 6.90s#356. They returnbvh::MISSfor a ray that hits a triangle exactly at a vertex (direction[0, 2, 5]), where two edge cross-products are exactly 0. Contractingp*q - r*sinto an FMA would flip that hit to a miss, but our DXIL carries no fast-math flags, so this needs the reporter's GPU and driver to confirm.🤖 Generated with Claude Code