GPU and shaders: Grand Theft Auto VI runs its first 3D scene on a 32-lane laptop GPU (wave64 split and fallback, capped heaps, null root views, castable stand-in views, mapped pipeline library) #3147
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3147
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3147"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@RaghavVijayanand on GitHub · 2026-11-26 10:16 UTC · original
RaghavVijayanand:gta6/run-fixes→main· +3389 −214 · 26 files · 20 commits · openFixes found while running Grand Theft Auto VI in Series S mode on a laptop: RTX 5060 Laptop (8 GB, 32-lane waves only), Radeon 780M iGPU beside it, 23 GB RAM, Windows 11. With these it gets past the hangs at the first 3D scene and runs it, with the camera moving. The lit image is still black at the end: what remains is in the lighting pass, below.
This is one branch on top of
main63bcca4. It carries #1960 (wave64 on 32-lane hosts), rebased onto today'smain, so it supersedes that PR. It also carries #2126 by @0xkn0wh3r3, which keeps relabelled thread ids unique in tiled group layouts, as one commit. On top of that is thesplit_idsfix by @0xkn0wh3r3 and @stem23456-coder: a 32x4 wave64 group paired the wrong host waves on NVIDIA. Its regression test fails without the fix on an RTX 5060.What is in it
Hosts this title did not run on
main'sds_bpermute, which reads within its 32-lane half, and keepsv_readfirstlanereading the first lane of EXEC after #2468 (scalar results unguarded).VICTORY_WAVE64_APPROX(opt-in): runs the refused wave64 programs in 32-lane waves anyway. They can be wrong, but they are not missing. Their loops stop afterVICTORY_WAVE64_LOOPSiterations (64 by default). At 64, some of the title's programs still kept the GPU busy for minutes at the first 3D scene. At 8 they all finish.Rendering
f6e47efa50226beb,3b90165a77d95cdf, …). Each case is logged once, with the address.Format twins: removed after review (they missed writes earlier in the same list). The castable view above is the path the title takes; @steven-seagull27's testpacked_lighting_uav_write_is_visible_to_a_same_list_rgb9e5_srv(ignored by default, needs a GPU) covers it.Memory and tools
host-pipelines-<n>.bin, because Windows refuses to replace a mapped file. They come every 5 minutes, not every 20 s. A run that made no pipeline writes only the early list.VICTORY_PATCH=<rva>:<hex>,...writes title bytes once, before the title runs. I used it to make the title render at 720p by rewriting its display-mode table.VICTORY_DISPLAY_MODElists another display mode.Where the black image comes from (for whoever continues)
From
VICTORY_CAPTURE_WORLD=30andVICTORY_DUMP_TARGETS=1: geometry and materials render.f0c91b4d2578f5bf's 853x480 targets show the characters and the room. The lit HDR target stays black:348e1e8c414c7ecaand63381c3250b287fawrite it, at 853x480, format 10. With this branch nothing is skipped and no root view drops a dispatch, so the next suspect is one of the lighting inputs.VICTORY_TRACE_SHADERS=348e1e8c414c7ecalists them.Testing
On the machine above, Windows 11 26300:
cargo clippy --workspace --all-targets [--all-features] --locked -- -D warnings: clean.cargo test --workspace --locked: passes, with two exceptions that behave the same on unmodifiedmain63bcca4on this machine.emit::memory_tests::heap_direct_texture_reads_mark_their_heap_indexcrashes with STATUS_ACCESS_VIOLATION, so it was skipped. The twostride_tests::a_heap_buffer_*tests andsynthetic_tests::gathers_at_a_level_match_the_hardwarefail.wave64_testspass on the RTX 5060 (split programs) and on the 780M. On a machine without a GPU (CI) they skip.🤖 Generated with Claude Code
@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-26 10:16 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
@steven-seagull27 on GitHub · 2026-11-26 10:41 UTC · original · edited 2026-11-26 10:55 UTC
I found an ordering case in the fallback format twin on
7e641689. I extended your 8×4 lighting-texture fixture (R32_UINTsource,R9G9B9E5twin) so it reads back both resources. Every texel gets a distinct seed; a second upload flips every bit. Both devices produced the following counts in two fresh processes each, with the D3D12 debug layer enabled.In the middle row all 32 twin texels still contained their own previous seed. This reproduced on the RTX 5080 (621.40) and Windows inbox WARP. It matches the placement of
format_twin::refreshin the prelude. If a lighting input uses this fallback and its producer writes earlier in that same list, the consumer can read the previous contents. The synthetic fixture uses a texture copy as its producer.Which path did the descriptor builder actually take? I also created 853×480 guest textures through the production resource and SRV paths, requested either
R9G9B9E5orR32_UINTas the resource format, and bound anR9G9B9E5SRV. I tried UAV and RT+UAV flags for both formats. All four combinations on each adapter bound the original resource with effective SRV format 67, with zero view-creation diagnostics. For the RGB9E5 resource, RTX used a castable R11G11B10 stand-in and WARP kept native RGB9E5. This rules out the fallback-twin ordering issue for those eight descriptor combinations here. A trace showing a lighting input actually binds a different underlying texture would be the discriminator in-game.I then dispatched a typed
R32_UINTUAV write followed by anR9G9B9E5shader read on the same list, using those production descriptors. Each adapter matched 128/128 sampled texels and 512/512 float components per run, twice, against a CPU shared-exponent decode. Pixel(108,60)held0x87251229and returned exactly(41/256, 137/256, 457/256, 1). The passing control is independently applicable to your PR and runs withcargo test --locked -p victory-gpu --all-features --lib packed_lighting_uav_write_is_visible -- --ignored --nocapture. Direct lighting-path testThe separate fallback test keeps your existing control and adds an opt-in same-list regression that currently fails after checking the next-submission recovery. Fallback reproduction commit
Set
VICTORY_D3D12_WARP=1to repeat on the software adapter. AI-assisted testing with synthetic texture data.@pickles976 on GitHub · 2026-11-26 11:10 UTC · original
Offscreen verification of
7e64168on Wine 11.0/Linux 6.17, RTX 4060 Laptop 8 GB (32-lane waves only, like your 5060), NVIDIA 590.48.1, DXVK 3.1.1, Rust 1.98.1. Caveat: locally built diagnostic-relaxed vkd3d-proton 3.2.02576c0b4adfae4a+(assertions disabled, allocator/listfrom_ifacevtable identity checks removed, null checks kept) — not stock-runtime certification. Local edits: theformat_twinand a small HRESULT probe test made fail-closed on a missing host (they otherwisereturnsilently); no production changes. One test thread, 9 GiB/512 MiB cgroup scope.Passing: all 11
emit::wave64_testspass on the real adapter (split-program dispatch/readback; fresh 6.04 s compile, 1.17 s run), includingv_readfirstlane's EXEC-lane fix at the head.format_twin::tests::a_twin_takes_its_textures_bytes_at_submissionpasses — the R9G9B9E5-of-R32_UINT twin takes the texture's bytes and keeps its format.pipeline::library::tests: 11/14 under Wine; three failures share one root cause — this host refuses an empty pipeline library. A local probe callingID3D12Device1::CreatePipelineLibrarydirectly records:vkd3d-proton matches Windows' incompatible-blob semantics (your
openfallback arm is reached correctly), but unlike Windows it refuses zero-length data, so the empty-library bootstrap at the end ofopenalways fails here. Failing on that path:a_library_loads_from_a_mapped_file,a_rejected_blob_gives_an_empty_library,pipelines_load_on_many_threads_at_once— all three panic atopen(...).expect("an empty library").mapped_files_round_trip, the generation naming/cleanup tests anda_pipeline_loads_while_a_save_holds_the_librarypass (a valid serialized blob does load). Runtime consequence under Wine/vkd3d-proton: first run (or any rejected blob) degrades exactly as your code intends —"no host pipeline library: pipelines are not kept"— so the title still runs, but the memory-mapped cache this PR adds gives no cross-run pipeline reuse on such stacks. On Windows, where you tested, the empty bootstrap succeeds; nothing here contradicts your results. Logverify-pr3147-gates.log/verify-pr3147-library-hr-probe.log(kept locally).Next for me is a guarded title trial of this branch (720p, Series S mode) — the wave64 split plus your capped view heaps and the null-buffer-view root fallback are exactly the loading-stage blockers I measured on this machine (310,720
title slot past the host heapwarnings, three refused compute IDs on the emulation approach). I will report the RAM trajectory and whether the first 3D scene is reached here.AI use: omp, harness model
openai-codex/gpt-6-astra, ran the checks and drafted this report. No upstream code changes or assets attached.@stem23456-coder on GitHub · 2026-11-26 11:10 UTC · original
Following the move from #1960, here is the integration patch, regression shader and CPU probe for the overlap with #2126. The original fix and RTX 5070 Ti test are by @0xkn0wh3r3 in their demo branch.
The patch was prepared on the combined #1960 (
fc61f2e) and #2126 (e214ce4) heads. It uses the logical Xbox thread ID insplit_idsfor both the half and the wave base. In our CPU probe the 32×4 layout went from 64 output slots written twice to all 128 written once, each with(id % 64, 64). The 128×1 and 16×8 controls passed too. Could whichever PR lands second carry the change and regression test? This patch needs both prerequisites and may need rebasing onto the current heads. Earlier verification. AI-assisted with Codex.@pickles976 on GitHub · 2026-11-26 11:14 UTC · original
Follow-up as promised: guarded title trial of
7e64168on this machine (same Wine/RTX 4060 Laptop 8 GB stack; 16 GiB RAM, cgroup 9 GiB/512 MiB, available-RAM guard floor 2,048 MiB).Result: stopped by the RAM guard during loading at 112.9 s, 1,757 MiB available (GPU 3,263 MiB) — the loading-stage memory wall on this machine is unchanged by this PR, and the empty-library refusal above means its pipeline-library lever is inert here.
What the run shows:
host view heap capped: title slots past the room left read null count=1245184 room=737853 views=1000000— the cap engages exactly as designed (1,000,000-view host limit probed), and the title's 1,245,184 slots leave 507,331 past the room; those read null, matching the count oftitle slot past the host heapwarnings one-for-one. Cleaner than before (a single explicit line, views accounted), but on a host that caps at 1M views the overflow slots are still null — the paging in #2121 is what would address them.no host pipeline library yet; starting an empty one→no host pipeline library: pipelines are not kept: the runtime consequence of the zero-lengthCreatePipelineLibraryE_INVALIDARG from my previous comment. First-run behavior is correct-graceful, but on vkd3d-proton every run is a first run: the library is never saved or re-mapped, so this PR's 2.4 GB private-copy savings never materialize on stacks like this one. A warm-cache trial on Windows is where that part pays off.XMemAllocatePhysicalPages/MapViewOfFile3tmpfs sections (measured at cgroup level: shmem 787→3,980 MiB over 80 s in a prior attribution run) exhaust available RAM before the world. That is not something this PR or #2121 addresses — it is title memory behavior on hosts with half your machine's RAM.No FPS, world-entry, or input-response claim. Logs kept locally (
20261126T111205Z*, capturesmenu-20261126T1112*.png).AI use: omp, harness model
openai-codex/gpt-6-astra, ran the checks and drafted this report. No upstream code changes or assets attached.@RaghavVijayanand on GitHub · 2026-11-26 11:24 UTC · original
@steven-seagull27 thank you. Your same-list case is right: the twin was only refreshed in the submission's prelude, so a write earlier in the same list never reached it. And your second finding agrees with what I saw in the title: in a run with the logging from
372d56f, the lighting textures took the castable view, and no twin was made.So in
4596ccbthe twin is gone. A fallback that misses same-list writes is worse than refusing the view. The castable-view fix (372d56f) stays, along with its once-per-format-pair log of views in a format of another family. I cherry-picked your direct-path test as0ddd54c, with you as the author. Here it passes on the RTX 5060 Laptop (--ignored, all features).The CI failure was the
wave64_tests: they asserted that some device ran each program, and the runner has no GPU (WARP's 4-lane waves run neither the split nor the WaveSize(64) form). They now print that they skipped, like the other hardware-only tests.Locally (RTX 5060 Laptop):
--all-features: clean.cargo test --workspace: passes, exceptstride_tests::a_heap_buffer_read_by_element_takes_the_views_stride,stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zerosandsynthetic_tests::gathers_at_a_level_match_the_hardware. All three fail the same way on unmodifiedmain63bcca4here, which I re-checked just now.@RaghavVijayanand on GitHub · 2026-11-26 12:40 UTC · original
@stem23456-coder @0xkn0wh3r3: done. This PR now carries both, so it is the "second to land" you asked about:
0167517: #2126's three commits (console_flat, the LDS rounding, thethread_idsmodule) as one commit, with @0xkn0wh3r3 as author. They are squashed because the first one alone takeslower.rspast the 512 KiB limit. Conflicts:Lower::thread_idtakesconsole_flat, as you resolved it.Host::wave_lanesis #2126'sResultversion, which the split's tests now unwrap. Both test-onlyLoweredfields are kept. If #2126 lands first, this commit drops out on a rebase.2eb38bb: thesplit_idsfix (half and wave base fromconsole_flat), with @0xkn0wh3r3 as author and @stem23456-coder as co-author, plus the 128x1 / 16x8 / 32x4 regression test aslane_order_tests::a_wave64_program_runs_as_the_console_runs_it_on_a_32_lane_host.synthetic_tests::lowered_foris from the patch. I left out the patch's comment and flag cleanups inlower.rsto stay under the size limit; they do not change behaviour.On an RTX 5060 Laptop, the new test fails at 32x4 without the
split_idschange and passes with it, so this card tiles 32x4 groups too. All 11wave64_tests, thelane_order_testsand #2126's own tests pass.Workspace tests: 313 of 316 in
victory-shader; the other crates all pass. The three failures are the ones that also fail on unmodifiedmainhere (stride_tests::a_heap_buffer_*,gathers_at_a_level_match_the_hardware). Clippy is clean with and without--all-features, and the asset policy passes.@pickles976: thanks for the Wine run. The empty-library refusal is real, and it predates this PR (
main'sopenmakes the same empty library). I'll look at starting without an empty library in a separate change, so vkd3d-proton stacks keep pipelines across runs too.@lhnizdo on GitHub · 2026-11-26 14:23 UTC · original
@RaghavVijayanand, an offer for this PR's split, in case you'd like it:
lhnizdo:pr/first-lane-scalars, one commit (809c945) on top of this PR's head2eb38bb.What it does: the split refuses
v_readfirstlane_b32in a block not every thread reaches (NOT_EVERY_THREAD), because the read goes through the halves' exchange. The title often does this for values that are the same in every lane: spilled SGPRs combined asv_sub_f32 v, s, sand read back into an SGPR inside a lane branch, or an integer division's reciprocal of a scalar. Its cloud program8b9483919d8d5e99is refused for 23 such reads.The commit follows the value back. If it was made by lane-wise arithmetic, selects and compares of scalars and constants only, with each step either earlier in the block with no EXEC write in between, or unguarded in a dominating block, then every lane active at the read holds it, and the read is the lane's own. No exchange, no sync.
Where it lives: in a new
lower/uniform.rs, with 6 lines inlower.rs, becauselower.rsis 343 bytes from the asset policy's limit on this head.Test:
wave64_tests::a_first_lane_read_of_scalars_in_a_lane_branch_needs_no_exchange. A spill, then the read in a lane branch of one console wave.The hardware run needs the Agility SDK in the test binary, which #2878 does; without it the GPU part skips here.
On a local stack (this split plus more of mine on top, so not this branch exactly):
Take it, change it, or leave it, whatever suits the PR.
AI-assisted (Claude Code); tests on my machine. No game data.
@Kajanos on GitHub · 2026-11-26 16:06 UTC · original
Windows 11 / RTX 5080 (32-lane waves) world run of this branch: the wave64 split removes the ~2.3 s loop-cap submissions with the default loop limit.
VICTORY_WAVE64_APPROX=1crashed at world load.Setup: Windows 11 Home build 26300, RTX 5080 16 GB, NVIDIA 621.40, Ryzen 9 9950X3D (with its Radeon iGPU beside the RTX), 64 GB. Retail 1.0.2.1, default console (Series X). Head
7e64168as is (onmain63bcca4),--profile diag --features diagnostics.translate --cache --pipelineswas run on the desktop before each mode. The title was played by hand to the same spot in the world, about 3 minutes there per run.Startup:
host adapter (high performance) adapter="NVIDIA GeForce RTX 5080",host wave lanes min=32 max=32 wave64=false. The adapter choice works on this two-GPU box.main63bcca4no room for the null buffer views)main+ #2461 + 2^18 dynamic slots, loop limit 2^20VICTORY_SHADER_LOOP_LIMIT=4096VICTORY_WAVE64_APPROX=1Plain mode (no approx)
translate: 543 of 25,985 shader containers refused. Pipelines:the host refuses it397 → 1,compute shader does not translate24 → 333.LDS shared without barriers by a wave64 group of 33 to 64 threads. 65:a wave64 cross-lane operation spanning both halves. 2:a lane mask read as data. 1 each:v_permlanex16_b32, barycentrics read directly, a descriptor read only as data, a 16-bit wave reduction in a wave64 program.2.6 fps, 387.4 ms/frame (114.3 preparing: copies 74.6 ms 436.3 MB …; 234.9 on the GPU; 35.7 copying back), about 3,000 draws/frame,dropped 337 without a host pipeline … and 67 indirect. Task Manager shows the GPU at 50–60%.crashes.log. Clean exit on closing the window.GPU timing (
VICTORY_GPU_TIMING=1+VICTORY_D3D12_DRED=1, plain mode, default loop limit):lists 189.1 ms/frame of wall time, their commands 173.2 ms/frame. Top programs by average ms per frame:0184869d6e47e5fa5552dac6a2b7a1fdce30cb330ef34306c7feccae4e01e4543b90165a77d95cdf512416d975ace48b857b2e13c9cc107f+ pixel63051e97862e7dad00167d58cc5a78d7With the default limit, the three indirect programs (
0184869d,ce30cb33,c7feccae, also in #71 / #898 / #1465) now cost what they cost on the other build at a 4096 cap, so they no longer run to the cap. Together they are still about half of the frame's GPU command time.5552dac6and3b90165aare new in the ranking. I have not checked whether they are programs this PR splits.VICTORY_WAVE64_APPROX=1translate: 229 containers refused (plain: 543), pipelinescompute shader does not translate24.unhandled exception 0xc0000005 at victory-image-…dll+0x23cf683 (write 0x0: nothing mapped there), on a thread that starts fromKERNEL32(title code, not VIctory).first bind … stage=compute … hash=c06aa62112ffba4c. In the 100 ms before it, a burst ofrefused buffer view: empty or past its copy start=0x0 first=0 count=0 element=4, oneunordered buffer view empty or past its host copy, and onea shader view in a format of another family than its host texture. GPU load showed 100% around that time, unlike plain mode.c06aa621is only the program bound at that frame.Not run:
cargo teston this head,VICTORY_WAVE64_LOOPSother than the default, a second approx run.AI-assisted (Claude Code)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.