Repository navigation
Conversation
…VICTORY_HALVES_FIRST_MEET) A v_readfirstlane_b32 of a lane-varying value in divergent code of a wave64 program run in 32-lane halves was refused (FIRST_ACROSS) and its pipelines' draws dropped. Behind VICTORY_HALVES_FIRST_MEET=1 it meets the other half through the rendezvous words (lower::meet): two words per read (whether the half has lanes there, its first lane's value); the lower half's value wins when it has lanes. Regions with a cycle also meet, sites only in the acyclic part before it. Tests: first_lane_reads_in_divergent_code_meet_between_halves (refused without, the console's value on every adapter with; mutation-checked), and an ignored probe that translates a folder of cached containers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…HALVES_FIRST_MEET off The read's operand was lowered before the switch was asked, so with it off a refusal there could carry the operand's reason instead of the first-lane one (a_cndmask_with_vccz_as_its_mask_keeps_the_first_lane_refusal). Also: first_meet's doc was joined to meet_halves', the pragyaangaur#688 test built Parts without the new field, and the new lines are formatted. 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.
What
VICTORY_HALVES_FIRST_MEET=1(off by default) lets av_readfirstlane_b32in divergent code of a wave64 compute program, run as two 32-lane halves, meet the other half through group-shared memory (lower::meet), where it was refused with "a first-lane read of a value that may differ between 32-lane halves". Each half puts whether it has an active lane there and its first active lane's value; the console's first active lane is the lower half's if it has one, else the upper half's.With the switch, a meet region may also contain cycles: sites count only in the acyclic part before every cycle, so the order of sites stays the one topological order the deadlock argument needs (see
meet_regions' doc).Off, nothing changes: the read keeps its refusal and the reason it gave before (the second commit makes sure of that;
a_cndmask_with_vccz_as_its_mask_keeps_the_first_lane_refusalcaught it). The translation differs with the switch, so the shader cache keys on it.Lanes are counted as #688 counts them:
first_meetgets the read's guard, whichguard()already ANDs withpred_active, so only lanes whose path is through the block ballot "this half has lanes here", and the "done with the site" count goes throughmeet_halves, which #688 fixed.Why
Run K-A dropped 300–450 draws/dispatches a frame for lack of a host pipeline (permanent, "0 being made"). 19 of the compute shaders that don't translate were refused on first-lane reads or next to them.
Measured
probe_translate_folderover those 19 shaders (Wine, D3DMetal):VICTORY_HALVES_FIRST_MEET=1Of the other 7: 4 still refuse a first-lane read (outside a meet region or in a loop), 2 now stop at "a lane mask read as data", 1 at "a wave reduction over both halves".
How many draws this brings back a frame is for a game run with
VICTORY_DROP_WHY=1(#696) and this switch.Tests
tools/macos/test-wine.sh -p victory-shader: 546 passed, 0 failed (includesfirst_lane_reads_in_divergent_code_meet_between_halves, which runs the met reads on the GPU against the console's result for each arm and group size).cargo test -p victory-shader --lib(native): 280 passed.cargo test -p xtask,cargo xtask policy: ok.🤖 Generated with Claude Code