Skip to content

Shaders: lane reads and writes where lanes branch differently run in the console flow - #320

Open
r4tedx wants to merge 46 commits into
Marvisak:mainfrom
r4tedx:shader/console-flow-lane-reads
Open

r4tedx wants to merge 46 commits into
Marvisak:mainfrom
r4tedx:shader/console-flow-lane-reads

Conversation

@r4tedx

@r4tedx r4tedx commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Current head 0fa6af4, integrated with main at ffe310e. The lane-read tests use structured resource tracking. The translator retains both the mask information used by console flow and the reach conditions used by the descriptor tracker. Local Windows verification: cargo test --workspace --locked (359 passed, 6 ignored) and all-target, all-feature Clippy with warnings denied. No title run for this update. AI-assisted (Codex).

Validation, resolved as not from this PR. A whole-title run on this head found that 20 of the 21 compute programs this PR newly translates fail dxil.dll validation, and I marked it a draft until the cause was known. It is: compute programs that sample with implicit derivatives (image_sample) are emitted as dx.op.sample, which validator 1.6 / 1.7 rules do not allow outside pixel shaders; main already emits 23 such modules. Diagnosis with a hand-assembled reproduction; #180 replaces these samples and #201 tracks the class. A census rerun by another tester measured it: with #180 (and #459) on main, the 23 compute failures of this class go to 0 and nothing that validated before fails. The console flow emits nothing different for them; this PR only lets 20 more such programs translate. Merging #180 first, or together, keeps those modules from reaching a driver unvalidated.

Fixes #225. Stacked on #233 (which is stacked on #223); the last three commits are new here (36e05dc, c223206, fd8b8fe; before the rebases onto main (now 8e79c80) on 2026-11-24 they were 6ec772f, 4c197a0, a5ba4a4, the ids testers' reports use; replayed unchanged, except that a new upstream test gets the field this PR adds to lower::Parts; CI's two clippy commands are clean at this head; the lane-read loop test now takes its devices from the SM 6.6 hardware-adapter list and skips when there is none, a fix first made at the top of the stack and folded in here).

What

On the console v_readlane and v_writelane ignore EXEC, and a wave runs a loop while any of its lanes does. The per-lane form runs branches and loops per lane, so a lane that left a loop or skipped a branch is not there to be read or written, and never sees the scalars set inside. Two measured cases on main:

A compute program with v_readlane or v_writelane and at least one branch that is not uniform now runs in the console flow from #233 on every host: every lane of a wave runs every block, EXEC guards the vector instructions, and branches are the console's s_cbranch_*, taken wave-wide.

  • Where the host runs the console's wave size, one host wave is the console wave. Ballots are the wave's own and nothing is exchanged, so there are no group-shared slots or barriers, and any group size and LDS are fine.
  • Where it does not (wave64 on a 32..32 host), Shaders: wave64 compute on 32-lane hosts, in halves and in the console flow #233's exchange applies as before.
  • A program the console flow cannot lower keeps the per-lane form (Parts::per_lane_only), so nothing that translated before is refused.
  • Not chosen for programs with whole-wave sections (their reductions are lowered as wave operations already) or ds_(b)permute.

SGPR spills (v_writelane to stash an SGPR, v_readlane restoring it) stay on main's per-lane form, since each restore is proven to be its SGPR: with the console's wave size on a host that runs it (as main), and with no wave size on a 32..32 host, where each restore is lowered as its SGPR. Spill-only wave64 programs therefore now translate on 32-lane hosts instead of being dropped, and spill + DPP programs run split rather than in the console flow. Test: sgpr_spills_across_a_divergent_branch_stay_per_lane.

docs/wave64-on-wave32.md shows as deleted in this diff: #233 folded that plan into docs/architecture.md, and the merge carries that up.

Small generalisations of #233's helpers: console_lane masks with the console wave size (waves of 32 too), console_ballot returns the host wave's ballot when nothing is split, and v_readfirstlane reads no high EXEC word in waves of 32.

The second commit closes a gap in the console flow itself, found through the test report on #233: the loop form compilers emit keeps finished lanes in an exit mask that starts as a constant 0, and the console flow's mask joins took only masks derived from EXEC or a VALU result, so such a loop stopped with a lane-mask join of an untracked mask. Structured::others now gives the lane's bit of constant and scalar-built masks for those joins. The per-lane form is unchanged.

How this relates to other open PRs

#269 makes scalars leave divergent loops and branches as the wave left them, with maxima over the host wave. In the console flow scalars are the wave's own by construction: with a local switch sending #269's four test programs through it, all four are exact on both adapters here, where #269's two scalar tests give per-half values on hosts that form 32-lane waves (details). This PR does not select the console flow for those programs.

In compiled shaders, the usual source of v_writelane / v_readlane outside whole-wave sections is SGPR spill slots: a scalar parked in a lane of a VGPR and read back later, whatever EXEC holds. #54 and #189 resolve spills at constant lanes in SSA, so the lane accesses disappear and the control flow stays per lane. Where that applies it is cheaper than this PR, and the two compose: with spills resolved first, fewer programs would ask for the console flow. This PR covers what is left: lanes computed at run time, and reads of another lane's own data.

Not verified

No game files and no console hardware were used: the expected values follow the ISA's EXEC and lane-access semantics. I did not measure how many of the title's programs take this path, or its cost on them. A tester's whole-title translate found 21 more compute pipelines than #233, 20 of them in the validation class above. The console flow guards instructions where the per-lane form branches around them, so a divergent program does more work per lane.

The fallback to the per-lane form has no test of its own; I found no hand-assembled program that the console flow refuses and the per-lane form takes.

Vertex, pixel and mesh programs are unchanged.

Tested

Windows 11, an NVIDIA RTX 5070 (32..32) and an AMD Radeon iGPU (RDNA2, 32..64) in one machine, hand-assembled GFX10, every lane checked:

  • emit/lane_read_loop_tests.rs (the Shaders: v_readlane inside a loop the lanes leave at different iterations reads wrong lanes (wave32 and wave64, every GPU) #225 repro, no longer ignored): exact on both adapters in waves of 32 and of 64 (on the RTX 5070 the wave64 program runs in two halves).
  • split_tests::lane_writes_reach_lanes_outside_the_branch: exact on both. With the new condition switched off it fails on the Radeon (lane 40 keeps 1).
  • split_tests::loops_run_while_any_lane_of_the_console_wave_does now checks 64-lane hosts too.
  • split_tests::loops_with_an_exit_mask_grown_from_zero (the compilers' loop form, a lane read in each iteration, the exit mask counted afterwards): refused on the RTX 5070 before the second commit, exact on both adapters now.
  • cargo test --workspace: 281 passed, 0 failed, 4 ignored at a5ba4a4 (two testers report the same count; 280 was the head before it). cargo clippy --workspace --all-targets: nothing new. cargo xtask policy: ok.

AI-assisted; no game assets were used.

🤖 Generated with Claude Code

@MisaXz

MisaXz commented Nov 24, 2026 •

Copy link
Copy Markdown

Test report for 5cc9a7e on a second machine with a 32-lane and a 64-lane adapter (following up on the #233 thread).

Tested

  • NVIDIA GeForce RTX 5080, driver 621.14 (32.0.16.2114), and the Ryzen 7 9800X3D's integrated AMD Radeon(TM) Graphics, driver 32.0.13018.6, in one machine; Windows 11 Pro 26300; Rust 1.98.1; debug
  • This PR at 5cc9a7e (base d2a4bae): cargo test --workspace --no-fail-fast: 280 passed, 0 failed, 4 ignored.
  • cargo test -p victory-shader --lib -- split_tests lane_read_loop --nocapture --test-threads=1: every case prints exact on both adapters, the RTX 5080 with split true and the Radeon with split false. That includes:

Not tested

Re-run on the new head a5ba4a4 (same machine, both adapters): cargo test --workspace --no-fail-fast: 281 passed, 0 failed, 4 ignored. cargo test -p victory-shader --lib -- split_tests lane_read_loop --nocapture --test-threads=1: 12 passed, every case prints exact on the RTX 5080 (split) and on the AMD Radeon(TM) Graphics iGPU (native).

AI use

  • Claude Code (Claude Fable 5.2) ran the tests and wrote this report from their output.

@SpaghettiMaster545

SpaghettiMaster545 commented Nov 24, 2026 •

Copy link
Copy Markdown

Update: the head is now fabe8bc, which adds only test validation in split_tests.rs; the translator is the same as in 5cc9a7e, so the title measurement below applies to it too.

Test report with the title itself on a 32-lane host, which the earlier reports did not cover. This PR's head 5cc9a7e (with #223 and #233 under it) against main d2a4bae.

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB, driver 621.24 (32.0.16.2124), 32-lane waves only; AMD Ryzen 7 9800X3D, 31 GB; Windows 11 10.0.26100; Rust 1.98.1 (pinned).
  • cargo test --workspace --no-fail-fast on 5cc9a7e (debug): 280 passed, 0 failed, 4 ignored.
  • The title (Xbox Series 1.0.2.1, build unknown (b99f876b…) as in build unknown (b99f876b74d4a77f03af5f878223b27bd647b5c35a79d5decd9f716504239e93) #5), diag build (--profile diag --features diagnostics) of each commit, each with its own empty VICTORY_CACHE_DIR, the same VICTORY_KEYS (Enter every 3 s from 8 s to 47 s: through the first-boot screens into story mode, which opens at 24 s in both runs), until the host GPU failure:
main d2a4bae this PR 5cc9a7e
shaders that do not translate 382 (compute 311, pixel 43, mesh 24, vertex 4) 465 (compute 401, pixel 39, mesh 21, vertex 4)
host pipelines refused by the driver (E_INVALIDARG) 119, all compute 0
fps before story mode / in the world 30 / ~1.2 30 / ~1.15
host GPU failure device removed at 111 s device removed at 115 s
  • Per program: of the 119 compute programs the driver refused on main, 26 translate and run with this PR, 90 now stop in translation with a reason (console wave64 lanes on a host without 64-lane waves: 67, a wave64 group sharing LDS without barriers on a host without 64-lane waves: 38, counted over all programs), and 3 were not reached in this run. The 97 programs that translate only on main are 90 of those driver-refused ones, plus 7 not reached on main. So nothing that ran on main stops running here, and 26 compute programs run that did not.
  • The world hang on this card (NVIDIA RTX 5070 Ti: world hang (DEVICE_HUNG) on 97c78d1 is not one program, not loops, not barriers; 77 compute pipelines refused #71) is unchanged: the device is removed at the same point, and world fps is the same.

Not tested

  • A 64-lane adapter (the Ryzen's RDNA2 iGPU has no mesh shaders, so it cannot run the world), VICTORY_ADAPTER, a release build of the PR.

AI use

  • Claude Code (Claude Opus 5.5) built both commits, ran the title and the tests, compared the two logs program by program and wrote this report.

@r4tedx

r4tedx commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Thank you for running the title, and for the per-program comparison: "nothing that ran on main stops, 26 run that did not" is exactly what I could not check.

Two things changed since 5cc9a7e that touch your numbers:

  • The head is now a5ba4a4, rebased onto a fix in Shaders: wave64 compute on 32-lane hosts, in halves and in the console flow #233 (3098672): a program with DPP or ds_swizzle and a v_readfirstlane is no longer split in halves, because the upper half read lane 32 where the console reads the wave's first lane (found with a hand-assembled case, wrong on an RTX 5070 before). Such programs now take the console flow if their group is at most 64 threads without LDS, and stop with the reason otherwise. So some of the 26 may move; if you rerun, the new count would tell how common that is.
  • A whole-title translate run on #233 gives the same picture over all programs: 98 gained, 0 lost, the rest stopped by the same two reasons.

Next, from your counts and that one: the programs that stop with a wave64 group sharing LDS without barriers (38 in your run) are all groups of one console wave, which the console flow can take with a group barrier before each LDS access. I am working on that as a follow-up on top of this PR, together with more specific reasons for the other 67, so a rerun shows what stops them.

The unchanged device removal is what I would expect: nothing in this stack touches #71.

No game data used on my side. AI-assisted.

AntoninMichelq pushed a commit to AntoninMichelq/VIctory-forkAMD that referenced this pull request Nov 24, 2026
On top of integrate/shaders2. Conflicts:
- lower.rs: Marvisak#265's scratch() stays; flat() takes Marvisak#294's root SRV/UAV doc.
- valu_tests.rs: the shader side's test helpers (emit with a Target) stay;
  Marvisak#294's two root UAV tests are appended.
- shader_cache.rs: both new tests kept (Marvisak#320 wave-size key, Marvisak#358 cache
  that cannot keep an entry).
- HostShader initialisers in scratch_tests.rs and valu_tests.rs get
  root_uavs; emit() calls in tests get Target::ANY.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
@SpaghettiMaster545

Copy link
Copy Markdown

Rerun on a5ba4a4, the same way as before (diag build on main d2a4bae, its own empty cache, the same VICTORY_KEYS, RTX 5070 Ti, driver 621.24):

  • Against main (the same main run as in my first report): of the 119 compute programs the driver refused there, 26 translate and run, 90 stop in translation, and 3 were not reached. 0 programs that ran on main stop. This is the same split as on 5cc9a7e.
  • Against 5cc9a7e, program by program: 0 lost and 0 gained. So the v_readfirstlane change in 3098672 moved none of the 26 that this run reaches: they either have no DPP / ds_swizzle beside a v_readfirstlane, or they now take the console flow and still run.
  • Reasons that appear only with the stack, over every program the run reached: console wave64 lanes on a host without 64-lane waves 53, a wave64 group sharing LDS without barriers on a host without 64-lane waves 37. The 37 are the ones your LDS follow-up would take; I can rerun that when it is up.
  • 472 untranslated in this run against 465 on 5cc9a7e. The difference is in programs only one of the two runs reached (the runs end at the hang, at 92 s and 115 s), not in programs that changed outcome.
  • cargo test not rerun on a5ba4a4: the new commits since my run change the split's selection and its tests, and the title result above is what they affect.

(Claude Code, Claude Opus 5.5: ran the build and the title, compared the two logs program by program.)

@r4tedx

r4tedx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

The follow-up I mentioned is up as #439 (head 88cb024, on top of #320): programs of one console wave per group that share LDS now take the console flow on 32-lane hosts, with a group barrier before each LDS access, and what still stops says why (a group of more than 64 threads, ds_permute across the halves, a whole-wave section).

If you rerun, the numbers that would tell the most are the count per reason on 88cb024 and, for the whole-title run, whether the validator accepts every emitted compute module. I could only check hand-assembled programs: they validate and are exact on an RTX 5070 and a Radeon iGPU, and I say in the PR that the LDS tests there do not prove the barrier is needed.

No game data used on my side. AI-assisted.

@miniongk

Copy link
Copy Markdown

Tested a5ba4a4 on an RTX 5080, driver 621.24, Windows 11 26300, with a local Xbox Series 1.0.2.1 copy.

cargo test --workspace: 281 passed, 0 failed, 4 ignored. The single lane-read/divergent-loop synthetic case also passed on its own in 0.53 s.

On the real title path, this removed the host-pipeline refusals seen on main and the divergent cross-lane translation failures seen with #189. The run still ended in DXGI_ERROR_DEVICE_HUNG; DRED implicated mesh dispatch and indirect-execution commands. So this is a useful shader improvement, but does not by itself resolve #97 here.

Only aggregate counts and error classes shared, no game data or raw game logs. AI-assisted (Kimi Code).

r4tedx added a commit to r4tedx/VIctory that referenced this pull request Nov 24, 2026
The validator's message for an operation the stage or the entry's
properties do not allow ("Entry function performs some operation that
is incompatible with the shader stage or other entry properties") names
neither the operation nor the property, and it is the only message when
the call is in the entry function itself.

`victory translate --validate` now adds to each validator failure what
our own module declares and calls: its thread-group size, its wave size
and its dx.op operations (`emit::last_module_summary`, kept per thread
when a module is finished). Nothing of the console program is in it, so
a report of counts per reason is enough to see what the refused modules
have in common.

Prompted by a report on Marvisak#233: modules that fail validation with that
message and still create pipelines, 20 of them new with Marvisak#320, which I
cannot reproduce with hand-assembled programs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@r4tedx
r4tedx marked this pull request as draft November 24, 2026 03:34
@r4tedx

r4tedx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@miniongk thank you for the run on the title. Two counts would make it usable as evidence, if you still have the logs:

Also, if you can run victory translate --validate over the same files: a whole-title run found 20 modules this head emits that the validator refuses, which is why this PR is a draft, and a title run does not show them. #439's head 9745f35 prints what each refused module declares and calls.

Counts and messages only, please. AI-assisted.

@EduAzevedo

Copy link
Copy Markdown

Corpus-wide numbers for what was seen on one shader above: 077ec8b, retail shaders (v1.0.2.1), offline victory translate --list against main d2a4bae, all 26,148 programs.

  • a descriptor neither loaded nor built: 298 → 3.
  • 294 of those (259 mesh, 35 vertex) now stop at a descriptor read from the first lane of a phi, so only one more program translates on this branch alone.
  • No program that translated on main stops translating.

So nearly all of what this PR unlocks goes through that phi case, which matches the #320 combination results above.

AI-assisted.

@r4tedx

r4tedx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

@EduAzevedo thank you. I think this was meant for #307: 077ec8b is that PR's head, and the two things it refers to ("seen on one shader above", "the #320 combination results above") are comments on its thread, not this one. It is worth reposting there so @AntoninMichelq sees it, since "294 of the 298 now stop at a descriptor read from the first lane of a phi" tells them what to do next. Nothing in this PR touches descriptor tracing.

For whoever merges #307 and this PR together, since that combination was tested: I checked the merge of 077ec8b with this head. There is one textual conflict, in emit/lower.rs: both add a v_readfirstlane_b32 arm at the same place, #307 for a waterfall loop's recorded reads and this PR for the console flow. Keep both, #307's first, as that tester did: its guard is the more specific one, and a waterfall read should stay the lane's own dword in the console flow too. #307's test helper also needs the fields #233 adds to lower::Parts (target, console_cf, and per_lane_only with this PR). I will do that on my side if #307 lands first.

From reading the merge only; I did not build or run the combination. No game data used. AI-assisted.

@EduAzevedo

Copy link
Copy Markdown

@EduAzevedo thank you. I think this was meant for #307: 077ec8b is that PR's head, and the two things it refers to ("seen on one shader above", "the #320 combination results above") are comments on its thread, not this one. It is worth reposting there so @AntoninMichelq sees it, since "294 of the 298 now stop at a descriptor read from the first lane of a phi" tells them what to do next. Nothing in this PR touches descriptor tracing.

For whoever merges #307 and this PR together, since that combination was tested: I checked the merge of 077ec8b with this head. There is one textual conflict, in emit/lower.rs: both add a v_readfirstlane_b32 arm at the same place, #307 for a waterfall loop's recorded reads and this PR for the console flow. Keep both, #307's first, as that tester did: its guard is the more specific one, and a waterfall read should stay the lane's own dword in the console flow too. #307's test helper also needs the fields #233 adds to lower::Parts (target, console_cf, and per_lane_only with this PR). I will do that on my side if #307 lands first.

From reading the merge only; I did not build or run the combination. No game data used. AI-assisted.

Im sorry, getting a little crazy here 😂

@upipibi upipibi mentioned this pull request Nov 24, 2026
80f5663 took SGPR spills out of the lane reads that ask for the console's
wave size, so a compute program whose only lane reads and writes are
spills lost WaveSize on every host, Target::ANY included, where main
gives the console's wave size and emulates the lane writes. Keep main's
per-lane form there: on a host that runs the console's wave size, any
v_readlane/v_writelane still asks for it. On a 32-lane host spills stay
per-lane with no wave size, and the console flow still skips them.

The test now wants WaveSize(64) on ANY and none on 32-32, both from the
first (per-lane) pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
r4tedx added a commit to r4tedx/VIctory that referenced this pull request Nov 25, 2026
Brings d5f8f2c (SGPR spills keep main's wave size where the host runs
it). `whole` keeps this branch's ds_bpermute_b32 exception beside
Marvisak#320's named_lane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@r4tedx

r4tedx commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Pushed d5f8f2ce for the triage note on SGPR spills: spill v_readlane/v_writelane keep main's per-lane form, with the console's wave size where the host runs it and none on a 32..32 host (each restore lowered as its SGPR). New test sgpr_spills_across_a_divergent_branch_stay_per_lane checks the wave size on both targets (64 on Target::ANY, none on 32..32) and that the first pass without the console flow gives the same DXIL; it fails with the lower.rs change reverted. Description updated.

Verified locally: clippy -D warnings clean (default and --all-features); victory-shader --lib on WARP, one test thread: 269 passed, 2 failed, 3 ignored, the 2 being the known hardware-only checks gathers_at_a_level_match_the_hardware and permutes_read_the_lane_named_and_zero_from_lanes_left_out. No hardware adapter and no title data used.

AI-assisted

alex3112 pushed a commit to alex3112/VIctory that referenced this pull request Nov 25, 2026
…console flow for lane reads where lanes branch differently) into the integration

Kept both sides in Lower::new: the instructions that decide the wave size are the live ones (dead SGPR spills through VGPR lanes do not ask for the console flow), quad derivatives count as in-half reads and numeric selects as whole-wave reads. The console and split forms of a mask ballot moved into our mask_ballot; a waterfall loop's first-lane read stays the lane's own before the console flow's arm; the wave-size checks open lower_ir; emit's threading retry passes the target on. Our tests name Target::ANY. Outside the shader crate the PR needs victory-gpu's host.rs (target()), pipeline.rs and shader_cache.rs (cache key by wave range), apps/victory main.rs and translate.rs (--host-lanes) and docs/wave64-on-wave32.md.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
desplmfao added a commit to desplmfao/VIctory that referenced this pull request Nov 26, 2026
…and Marvisak#320)

Conflicts in crates/victory-shader/src/emit/lower.rs, both sides kept:
- main's scalar_def/sgpr_operand/scalar_constant helpers beside Marvisak#439's
  numeric();
- Marvisak#439's console_read_lane beside main's helper-lane doc of helpers_read;
- main's uniform_join beside Marvisak#439's never_taken (false in the console flow);
- the lane-mask phi: main's number-at-a-uniform-join and no-lane-on-edge
  arms, with Marvisak#439's console-flow `other` masks as a fallback for the tracked
  mask; lane_bit now returns a Result (Marvisak#439), refused in a split program
  outside the console flow.
Tests main added since Marvisak#439's base get Marvisak#439's new Parts fields and emit's
Target argument (memory_tests heap test, mod.rs pixel-input test).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
r4tedx and others added 4 commits November 26, 2026 06:51
The one conflict was in apps/victory/src/main.rs, where main's
`--jobs` became a `NonZeroUsize` and the branch added `--host-lanes`:
`translate::run` takes both, `jobs.map(NonZeroUsize::get)` as main
passes it and the branch's `host_lanes` after it.

The `emit` and `lower::Parts` call sites main added in tests (census,
crosslane, memory, synthetic, `emit::tests`, `resource` and lower.rs's
own) pass `Target::ANY`, as the earlier merge did for the ones before
them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pure move, so that the merge of main (63bcca4) keeps emit/lower.rs
under the asset policy's 512 KiB limit: the inline `mod tests` becomes
`mod tests;` beside `mod bvh;`, and its body, one indent level less and
otherwise unchanged, is emit/lower/tests.rs. Its `super::` paths still
name `lower`.

Moving the tests out of lower.rs is desplmfao's idea (Marvisak#2309).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… flow

Conflicts, resolved with kawaii-shakal's notes on Marvisak#439:

- emit/host.rs: main's process-wide WARP device (`SharedDevice`,
  `WARP_LOCK`, `lock_warp`, `from_device`) is kept, and its
  `create_device` takes an optional adapter for the branch's
  `VICTORY_ADAPTER` and `Host::on`.
- emit/lower.rs: `console_read_lane` stays beside main's new
  `helpers_read` doc; main's `uniform_join` sits above `never_taken`,
  which keeps the branch's console-flow note.
- Lane-mask joins: main's path for data joined with masks at a uniform
  join (the BVH walks pop masks from memory) stays beside the console
  flow's masks; `lane_bit` now returns a `Result`, so it takes `?`.
  `no_mask_lane_on_edge` is kept out of the console flow, whose lanes go
  along the wave's edges.
- emit/lower/tests.rs (lower.rs's tests, moved out before this merge):
  main's test changes are ported there. Its `lowers` helper calls
  `lower` directly, so it now lowers a program again in the console flow
  when the first try asks for it, as `emit_with` does
  (`a_scalar_result_needs_no_exec`).
- The `lower::Parts` sites main added in tests (crosslane, memory,
  synthetic, lower's) pass `console_cf: false`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… branch

Conflicts:

- emit/lower.rs, lane-mask joins: the branch's console-flow masks
  (constants and masks built from scalars, `st.other`) feed main's
  `match`, which keeps main's path for data joined with masks at a
  uniform join (the BVH walks) and keeps `no_mask_lane_on_edge` out of
  the console flow, after kawaii-shakal's notes on Marvisak#439.
- emit/lower.rs's tests now live in emit/lower/tests.rs (moved on the
  console flow branch): the branch's `per_lane_only: false` lines are
  ported there, and the `lowers` helper keeps the per-lane form where
  the console flow cannot lower a program, as `emit_with` does here.
- The `lower::Parts` sites main added in tests (crosslane, memory,
  synthetic, lower's) pass `per_lane_only: false`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@r4tedx

r4tedx commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Merged current main (63bcca4) in, with no rebase or force-push. Head now db85706, and it merges cleanly with main. The PRs above (#439) are merged from this head in turn. Details, conflict notes and the per-level checks are on #439 (policy ok, clippy clean, the WARP shader suite has only main's own 4 failures).

Synthetic tests only; no title data used.

AI-assisted

r4tedx and others added 3 commits November 26, 2026 07:11
Main's view-mark test builds emit::Options by hand; this branch adds a
target field to Options, so the test now fills the rest from Default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@r4tedx

r4tedx commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Correction to my last comment: CI's clippy failed on the previous head. Main's view-mark draw test (crates/victory-gpu/src/draw.rs) builds emit::Options { view_marks: true } by hand, and this stack adds a target field to Options. My local clippy run left out the test targets, so I missed it. New head 85362ace has the fix merged up from #233: the test fills the remaining fields with ..Options::default(). Nothing else changed.

Verified on #223 0f6dec04 and #439 8a320556: cargo clippy --workspace --all-targets --locked -- -D warnings is clean, and cargo xtask policy passes. No title data was used.

AI-assisted

r4tedx and others added 3 commits November 26, 2026 07:17
Main's placed-UAV diagnostics test calls emit::emit with the six arguments
it had before this branch added the target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@r4tedx

r4tedx commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Second follow-up: CI's diagnostics clippy (--all-features) found one more call from main that this stack's Target argument breaks. In crates/victory-gpu/src/pipeline/placed_uav_tests.rs:77, emit::emit was called with six arguments. New head 960b3e19 has the fix merged up from #233: the call passes emit::Target::ANY, the same default the other callers use.

Verified on #223 fbfd3c67 and #439 13be4c2c: both CI clippy commands are clean, cargo clippy --workspace --all-targets --locked -- -D warnings and the same command with --all-features. I didn't run the CI cargo test --workspace step on this PC, so CI will be the first to run it on this head. No title data was used.

AI-assisted

@r4tedx

r4tedx commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

This triage reviewed 85362ace. The placed_uav_tests.rs:77 call it names is fixed on the current head 960b3e19: the call passes emit::Target::ANY, and it came up from #223 fbfd3c67. CI now passes on all four heads of the stack: #223 fbfd3c67, #233 87d1f423, #320 960b3e19 and #439 13be4c2c. Merge order is unchanged: #223, then #233, #320, #439.

AI-assisted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shaders: v_readlane inside a loop the lanes leave at different iterations reads wrong lanes (wave32 and wave64, every GPU)