Repository navigation
Conversation
|
AMD run on a host that offers both wave sizes (RDNA4, 32–64): head
AI use
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…) in older tests, a u64 storage size Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…64 stack For testers: the wave64 stack (Marvisak#223, Marvisak#233, Marvisak#320, Marvisak#439) with Marvisak#180, whose sampleGrad form makes compute programs that sample with implicit derivatives pass dxil.dll validation. One conflict, in emit/lower.rs, where a compute program is found to need the console's lanes: Marvisak#180's quad gradients read within four lanes, so they go with DPP and ds_swizzle among the reads that stay inside a 32-lane half, and such a program runs on a 32-lane host in two halves. Checked on an RTX 5070 and a Radeon iGPU: cargo test --workspace passes, and a hand-assembled compute image_sample validates and samples the right value in groups of 64x1x1, 8x8x1, 32x1x1, 128x1x1 and 4x4x2.
…73d66, and Marvisak#180) The wave64 stack (Marvisak#223, Marvisak#233, Marvisak#320, Marvisak#439, with Peter Bonanni's whole-wave sections across the halves, 9b73d66) merged with Marvisak#180 (twin descriptor loads and quad gradients for compute samples), at 24b3bcc. That commit has one parent (e49302a); Marvisak#180's changes come in without its commits. Marvisak#233 is in this tree as 1eb9995, the same tree as 3098672, so each file was merged with 3098672 as the base instead of the e0865d2 git chooses. Conflict resolutions: - emit/wave.rs, v_permlane16/x16 in whole-wave sections: Marvisak#98's "every lane active" and 9b73d66's "or fi set" are both kept, for both instructions. - emit/lower.rs, Lower::new: Marvisak#320's test for lane reads and writes in divergent programs counts live instructions only, as Marvisak#233's does with Marvisak#309 (dead SGPR-spill lane instructions are no lane reads). Marvisak#307's waterfall arm of v_readfirstlane still comes before the console-flow arm; Marvisak#320 adds no arm of its own. - Compute samples with implicit derivatives (Marvisak#160, Marvisak#180, Marvisak#306): Marvisak#180 decides plain and biased samples, all of Marvisak#160's forms of them (implicit_derivatives from sample_form: _o, _cl, cube, a16), with Marvisak#160's bias address (bias_at) and level clamp; Marvisak#306's validator 1.8 is now declared only for what still uses the host's derivatives in compute (comparison samples, op 64). The Marvisak#306 test of image_sample now asserts no 1.8 (48-byte PSV0) and still validates and creates the pipeline; a twin test with image_sample_c asserts 1.8. - sgpr_spill test (Marvisak#309): without forwarding, the per-lane form still stops with "a lane mask holding lanes elsewhere read as data", but emit now takes the console flow (Marvisak#320); the test checks both, and that forwarded spills do not ask for the console flow. - Mechanical: per_lane_only in two hand-built Parts in emit/lower.rs tests; emit/mod.rs module order (split_tests before threading). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… lane count past 32 KiB) AnoHunted's Marvisak#459: a mesh shader whose declared vertex and primitive maxima take more than D3D12's 32 KiB of outputs declares the lane count instead, where that is lower. No textual conflict. Mechanical, crates/victory-shader/src/emit/mod.rs: git placed Marvisak#459's three test items at the end of the file, inside `atomic_tests` (Marvisak#48's module, which is last in this tree); they are moved to the end of `tests`, where Marvisak#459 has them, and its `emit` call passes `Target::ANY` (Marvisak#223's argument). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…rol flow; waterfall loops proven) Marvisak#566 is stacked on Marvisak#307, which this tree holds as its first two commits (the tree's resource.rs was identical to ffa6635's). The merge so also brings Marvisak#307's last two commits, 077ec8b and 6285e19. Git found upstream main as the base, which sets Marvisak#307's own lines against themselves; each file was merged with ffa6635 as the base instead. - crates/victory-shader/src/resource.rs: Marvisak#566's, unchanged (the tree had no edits of its own there). - crates/victory-shader/src/emit/lower.rs: no conflict on that base. The tree's lowering is kept (Marvisak#307's waterfall arm of v_readfirstlane before the console-flow form, fetched_index through Marvisak#483's heap guard), with Marvisak#566's Source::LanePhi arms and tests. lane_heap_index joins the indices heap_index and fetched_index return, so each is already guarded. Marvisak#226's annotation test passes the per-lane form to track. - crates/victory-shader/src/structure.rs: both sides' additions kept: MAX_MEMO (Marvisak#288) with MAX_MEET, and in Structured the wave64 stack's execs, others and pairs with Marvisak#566's reach and paired_masks. paired_masks is filled last, since it takes the masks pairs reads. - crates/victory-shader/src/emit/mod.rs: translate keeps Marvisak#309's spill forwarding and Marvisak#223's target, structures first and passes the per-lane form to track as Marvisak#566 does. The threading retry of emit passes its own. The tests' helpers (Marvisak#223's, Marvisak#306's, Marvisak#459's, Marvisak#48's) pass it too. - apps/victory/src/translate.rs: Marvisak#566's arm (Source::LanePhi is no leaf); the tree's fix already counted Fetched as loaded, as 077ec8b does. - docs/architecture.md: no conflict on that base; Marvisak#566's text. - emit/image_tests.rs (Marvisak#160), emit/lane_read_loop_tests.rs (Marvisak#439), sgpr_spill.rs (Marvisak#309, Marvisak#320): track takes the per-lane form. Helpers that return the error keep the order of failures (resources, I/O, then structure). - emit/waterfall_tests.rs (new, Marvisak#566): lower::Parts gets the tree's target, console_cf and per_lane_only; the dispatch fills Marvisak#483's guard dwords. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
e0865d2 to
b2adc37
Compare
|
Rebased onto Upstream merged 32 PRs. This PR still merged without a textual conflict, but two new upstream tests in The title was not used in these tests. AI-assisted (Claude Code). |
…entrics) By AntoninMichelq. Conflicts and what was kept: - emit/lower.rs (the interpolation's packing): Marvisak#176's `half_inputs` lookup, with the PR's `total` closure after it. - io.rs: Marvisak#179's `Halves` made on demand (`halves.get_or_insert_with(|| Halves::new(p))`), with the PR's `push_pair`; both sides' tests. - emit/mod.rs (the PR's test helper `pixel`): Marvisak#566's per-lane argument of `resource::track` and Marvisak#223's `Target` argument of `emit`; the helper still fails on resources, then I/O, then structure. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
b2adc37 to
1b012df
Compare
A compute shader that reads other lanes declares the console's wave size. NVIDIA runs waves of 32 lanes only (D3D12 reports 32..32), so a console wave64 program of that kind was refused at pipeline creation and its dispatches were dropped without saying why. The host's wave range (D3D12 options 1) now goes into translation as `emit::Target`. A shader that needs a wave size the host does not run stops there with the reason, the shader cache keys entries by the range, and the run logs the range once with a warning when 64-lane waves are missing. `victory translate --host-lanes 32-32` counts these shaders without a GPU. This is the first step towards running these programs as two 32-lane waves on such hosts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1b012df to
1dfb859
Compare
|
Automated triage for the maintainers. Merge candidate (as before the rebase). Reviewed head What I checked: CI: passing. Generated by Claude Code |
Conflicts were where main's write marks (`emit::Options`, `emit_with`, `translate_with`, `Parts::view_marks`) and its warm-up (`translate --cache`, `host_shader` returning whether the entry was cached) met the branch's `Target`: - emit: `Options` gains `target` (default `Target::ANY`), so main's `emit_with` and `translate_with` keep their signatures; `emit(.., target)` and `translate_for(c, target)` stay as they were and fill it in. `Parts` has both `target` and `view_marks`. Main's retry with `structure::killing` is kept as it is. - shader cache: `host_shader(container, target)` translates with main's write marks for `target` and keeps main's (result, cached) pair; the branch's key function is renamed `host_key`, since main now has a `key` for the build. - `translate --cache` (new on main) asks `shader_cache::host_target()`, which is what a run's `pipeline::translate` uses, so warm entries are keyed as the run looks them up; `--cache` refuses `--host-lanes`. - `translate` (the census) passes its target with main's `view_marks: true`; `--pipelines` documents both the host's wave sizes and main's pipeline library. - victory-gpu `Host` keeps both `target` and main's `heap_atomics64`. - The `Parts` and `emit` call sites main added (the `fuses_fmad` probe in `emit/host.rs` and tests in bvh, memory, semantics, stride, synthetic, valu and `emit::tests`) pass `Target::ANY`. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Updated for the needs-rebase triage: Conflict resolutions worth reading:
Both CI clippy commands are clean. Tests ran on the software renderer only at this level (the machine's GPUs are on a hold today), plus the CPU-only crates. AI-assisted (Claude Code). |
Co-Authored-By: GPT-6.2 Sol (Codex) <noreply@openai.com>
|
Fixed in |
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>
|
Merged current Synthetic tests only; no title data used. AI-assisted |
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>
|
Correction to my last comment: CI's clippy failed on the previous head. Main's view-mark draw test ( Verified on #223 AI-assisted |
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>
|
Second follow-up: CI's diagnostics clippy ( Verified on #223 AI-assisted |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Reviewed and verified at head fbfd3c67 against origin/main (63bcca43) on Windows 11 across both an NVIDIA RTX 5090 (wave32-only: 32-32) and WARP (4-4), with VICTORY_D3D12_DEBUG=1 and Windows SDK dxil.dll:
- Design & correctness:
Host::target()(crates/victory-gpu/src/host.rs:1074-1105) andemit::host::Host::target()(crates/victory-shader/src/emit/host.rs:201-221) queryD3D12_FEATURE_D3D12_OPTIONS1once (WaveOps && WaveLaneCountMin > 0), fall back cleanly toTarget::ANY(4..=128), and warn clearly when 64-lane waves are absent.shader_cache::host_key(crates/victory-gpu/src/shader_cache.rs:84-114) hashesbuild || target.key()(lanes_min || lanes_max) with BLAKE3 so shader cache entries are isolated per host wave range;victory translate --cache(apps/victory/src/translate.rs:360, 392) uses the samehost_target()and conflicts with--host-lanes(apps/victory/src/main.rs:108), preventing mismatched warm-up entries.s.wave_sizeis only set inLower::new(crates/victory-shader/src/emit/lower.rs:606) beforeLower::run(lower.rs:1298-1314) checks!self.x.target.runs(n), so every compute program declaring an unsupported wave size (cross-lane operations or single-wave barrierless LDS) stops cleanly at translation with a concrete reason instead of emitting DXIL refused at pipeline creation. Programs without lane-layout dependence and hosts supporting 64-lane waves are unaffected.- File-size check:
crates/victory-shader/src/emit/lower.rsis 521,592 bytes (2,696 bytes below the 512 KiB policy limit).
- Verification:
- Clean
git merge-treeagainstorigin/main(63bcca43);cargo xtask policy(191 files ok);cargo clippy --workspace --all-targets --locked -- -D warningsclean with both default features and--all-features. - RTX 5090 + SDK
dxil.dll:emit::tests::what_translates_for_the_host_creates_a_pipelineprintshost waves 32-32and passes (wave32 creates a pipeline, wave64 stops at translation, and theTarget::ANYwave64 fallback is confirmed refused by the driver); all 3 newemit::testswave tests pass;crosslane_tests+waterfall_tests+valu_tests+bvh_tests+semantics_tests93 passed, 0 failed, 1 ignored;apps/victory14 unit + 4 integration passed;victory-gpu(--features diagnostics,VICTORY_D3D12_DEBUG=1)shader_cache::tests+draw::tests25/25 passed. - WARP (
VICTORY_WARP=1,VICTORY_D3D12_WARP=1,VICTORY_D3D12_DEBUG=1):emit::tests::what_translates_for_the_host_creates_a_pipelineprintshost waves 4-4and passes;victory-gpushader_cache::tests+draw::tests25/25 passed.
- Clean
LGTM.
…arvisak#439): exact Wave64-on-32-lane compute
Dukestar69
left a comment
There was a problem hiding this comment.
LGTM — verified on Windows (RTX 5090):
cargo test -p victory-shader --lib emit::tests::passed (20/20, includingprograms_reading_no_other_lanes_translate_for_any_wave_size,console_lanes_translate_only_for_hosts_with_that_wave_size, andwhat_translates_for_the_host_creates_a_pipeline)cargo test -p victory-gpu --lib shader_cache::(5/5, includingkeys_tell_hosts_wave_sizes_apart) anddraw::(20/20) passed on RTX 5090cargo clippy -p victory -p victory-gpu -p victory-shader --all-targets -- -D warningspassed with 0 warningscargo xtask policypassed (191 files ok)
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Current head
714b818, integrated withmainatffe310e. The emitter and its tests pass the host wave target through upstream’s structured descriptor tracking. Local Windows verification:cargo test --workspace --locked(346 passed, 6 ignored) and all-target, all-feature Clippy with warnings denied. No title run for this update. AI-assisted (Codex).Rebased onto
main8e79c80on 2026-11-24 (twice that day; upstream merged about 55 PRs and added CI). New upstream tests callemitand buildlower::Partsdirectly, so they now passTarget::ANY. Nothing else changed. Head1dfb859, wase0865d2before the rebases. CI's two clippy commands (-D warnings, with and without--all-features) are clean at this head. CI's first run here failed in one test of this PR,what_translates_for_the_host_creates_a_pipeline: the runner's default device is Windows' software renderer, whose waves are 4 lanes, so not even the wave32 program translates for it, and the test only expected that of the wave64 one. The test now accepts a host without waves of the program's size; reproduced and checked here withVICTORY_WARP=1.What
A compute shader that depends on the lane layout declares the console's wave size. On a host whose D3D12 wave range does not contain it (NVIDIA reports 32..32), a console wave64 program of that kind was refused at pipeline creation. Its dispatches were then dropped, and the log said only "host pipeline refused".
emit::Target { lanes_min, lanes_max }(D3D12 options 1,WaveLaneCountMin/Max) goes into translation:emit::translate_for(container, target), andemit::emittakes it too (translatekeeps its old meaning asTarget::ANY). A shader whose declared wave size the host does not run stops at translation, with the reason (console wave64 lanes on a host without 64-lane waves, or the one-wave-LDS case).victory-gpu:Host::target()reads the range once, logs it, and warns when there are no 64-lane waves. The shader cache keys entries by the build and the range, so a translation for one host's waves is never served to another.victory translate --host-lanes 32-32(or32-64, or a single size) counts these shaders without a GPU.--pipelinestranslates for the local device's range.shader::host::Hostused by tests and tools getstarget().This changes nothing for hosts that run 64-lane waves.
#208 also reads options 1, into
HostCaps(supports_wave64,wave_lane_count_max) for logging. It does not feed translation or the cache key. Whichever merges second,Host::target()can become a thin wrapper over those caps. #189, #192 and #54 change what the translator emits on such hosts. This PR only adds the plumbing they can key their choice on (and the cache key they need to stay correct when one machine has GPUs of both kinds), plus an explicit refusal where nothing handles the program yet.#235 (the non-Windows build) adds a stub
Hostfor hosts other than Windows that has notargetmethod, andtranslate.rscalls it here. The two merge without a textual conflict and then the app crate does not build on macOS or Linux (found by a reviewer on #439). Whichever lands second addstarget()returningTarget::ANYto that stub; I will do it on my side if #235 goes in first.Not verified
I did not count how many of the title's programs the refusal hits;
--host-lanes 32-32is there to do that. A tester has since counted it on their own copy: 321 compute programs declareWaveSize(64)onmainand are refused by a 32-lane driver.#54 has since gained a commit (
4083d25) that also queries the device's wave range and puts it in the shader cache key, through its ownWaveRangetype. The two overlap there; I have not merged them together, and whichever lands second has to adopt the other's type.Tested
Windows 11, an NVIDIA RTX 5070 (32..32), synthetic only:
emit::tests: a hand-assembled wave64 compute program withv_readlanetranslates forTarget::ANYand for 32..64, and stops with the reason for 32..32. The same code as wave32 translates for both. A program reading no other lanes translates for any range.ANYis refused by it (what this replaces).shader_cache: keys differ between 32..32 and 32..64 and between builds.cargo test --workspace: 268 passed, 0 failed, 4 ignored.cargo clippy --workspace --all-targets: nothing new.cargo xtask policy: ok.AI-assisted; no game assets were used.
🤖 Generated with Claude Code