Repository navigation
Description
Purpose. This issue is the one place where work is claimed, so two people do not do the same thing. Pick a task below, comment I take T<n> (for example I take T7), and start. When you stop or hand it back, comment I drop T<n>. The maintainer ticks a box when the pull request is merged and writes the pull request number next to it. Tasks nobody has touched for two weeks may be given to someone else.
Status as of 2026-11-26: the title reaches the world scene on a 32-lane NVIDIA GPU (RTX 5070) without a device removal (#1, #16, #17, #18 are closed; PR #19 and PR #20 are merged; also merged on 2026-11-26: #21, #24, #26, #30-#32, #34, #35, #37-#45; also merged: #22, #23, #25, #27, #28, #33, #36; open: #14, which did not speed up the frame in our measurements). The scene runs at about 1 fps: one frame takes about 1 s (CPU preparation 450-1100 ms, GPU 70-470 ms, copy-back 70-130 ms). The target is 30 fps (33 ms per frame). About 1000 draws per frame are dropped because no host pipeline exists for them, and 1000-1400 more are indirect draws that are not drawn.
Rules
- One task per pull request. Say
T<n>in the title or the first line of the description and link this issue. - Small pull requests. A change that mixes several topics is the first to be dropped when it conflicts.
- Tests must pass:
cargo test -p viport-gpu(andcargo test -p viport-shader --lockedfor shader work), pluscargo clippy --workspace --all-targets --locked -- -D warnings. Add a test when the behaviour can be tested with synthetic input. - Do not commit generated caches (shader cache, pipeline library,
viport.toml, logs, captures). - Nothing from the game, ever: no game files, shader dumps, screenshots or captures (see
docs/asset-policy.md). Describe what you saw in words. Read your logs before attaching them: they may contain paths from your machine. - For performance work, post numbers from before and after (frame time from the window caption, or the
VIPORT_PROFILEoutput), the GPU and the driver. - Read
CONTRIBUTING.mdfirst. Changes tobuild.rs, CI, scripts or dependencies need an issue and a conversation before the pull request.
Diagnostics you will need
Names are those documented in README.md or defined in the source (the file is given where the README does not list them).
VIPORT_LOG=<target>=debug,...: log output.VIPORT_D3D12_DEBUG=1andVIPORT_D3D12_DRED=1: debug layer and device-removal report (diagnostics build:cargo build --profile diag -p viport --features diagnostics).VIPORT_GPU_TIMING=1: every list of a submission runs and is timed on its own; slow lists are logged.VIPORT_PROFILE=<ms>: sampling profiler of our threads (crates/viport-gpu/src/profile.rs).VIPORT_ASYNC_SUBMIT=1: experimental, off by default: host submissions are landed by a thread of ours (crates/viport-gpu/src/host.rs).VIPORT_PIPELINE_WORKERS=<1..64>: number of pipeline compile workers (crates/viport-gpu/src/pipeline/make.rs).VIPORT_MESH64_ON_32=1,VIPORT_WAVE64_ON_32=1: run 64-lane console mesh / compute programs as 32-lane host waves. The mesh one can still remove the device.VIPORT_SUBMIT_MAX_RUNS=<n>,VIPORT_SKIP_PIPELINES=<hash,...>,VIPORT_PIPELINE_LOG=<file>.
Already in progress (open pull requests, do not duplicate)
PR #21 (CI clippy errors), PR #22 (v_dot8_i32_i4), PR #23 (ds_wrap_rtn_b32), PR #24 (XMA end of frame), PR #25 (s_atc_probe), PR #26 (PE section bounds), PR #27 (move lower.rs unit tests). Review them if you like; do not open a second one for the same thing.
Task list
Difficulty: easy = a few hours without game files; medium = needs a Windows GPU and the game; hard = needs profiling and design work. Every task starts as owner: unclaimed.
Performance to 30 fps
- T1 Title texture upload and refresh cost per frame: find what
Staging::refresh(crates/viport-gpu/src/texture.rs) re-reads each frame withVIPORT_PROFILE, and cut it. Area: GPU host. Difficulty: hard. Related: Coordination: single upstream pull requests outside the bundles #3 (PR GTA VI: the rest of our work to reach the lit world (draft) #14 has a copy-back of only the changed byte runs). owner: unclaimed - T2 Write-watch cost in
copy_beginand the watch: port the four GPU write-watch fixes from upstream #1610 onto the currentcrates/viport-gpu/src/watch.rs,shadow.rsandtexture.rs, one fix per pull request, each with a test that fails without it. Area: GPU host. Difficulty: hard. Related: Tracking: what is merged into V2 and what is not #2. owner: unclaimed - T3 The submission path waits for the previous submission to land. Maintainer's result on 2026-11-26 (RTX 5070,
VIPORT_ASYNC_SUBMIT=1, world scene): it does not speed up the frame (about 950 ms either way). The remaining wait is a real data dependency, not a wide footprint: the copy-back of the submission in the air overlaps title memory that the next submission refreshes. Making it faster means reducing the copy-back itself (T1, T4). Still open for reports from other GPUs: run it for at least 5 minutes in the world, report frame time and any device removal. Area: GPU host (host.rs). Difficulty: medium (report). Related: Hardware reports: how far it gets on your machine #4. owner: maintainer (done for RTX 5070), reports unclaimed - T4 Per-submission snapshot copies of big buffers (about 28 submissions per frame): measure which buffers are copied and how many bytes per submission, then skip the copies that cannot have changed. Area: GPU host (
shadow.rs). Difficulty: hard. owner: unclaimed - T5 GPU time of the roughly 2000-3000 heap-indexed draws: with
VIPORT_GPU_TIMING=1andVIPORT_D3D12_DRED=1find the slowest lists and commands and say what makes them slow. A written finding with numbers is a valid result. Area: GPU draw. Difficulty: hard. owner: unclaimed - T6 About 1000 draws per frame are dropped for lack of a host pipeline: collect the logged reasons (
shader does not translate, and the others named incrates/viport-gpu/src/pipeline.rs), count draws per reason, and post the table. Area: GPU pipeline. Difficulty: medium. Related: T7. owner: unclaimed - T7 Indirect draws that are not drawn (1000-1400 per frame): find out which signature or argument layout they use and why
crates/viport-gpu/src/indirect.rsskips them; fix one case with a test. Area: GPU draw. Difficulty: hard. owner: unclaimed - T20 GPU spikes: with
VIPORT_GPU_TIMING=1a 110 s world run on an RTX 5070 logged 5slow host submissionwarnings of 380-3085 ms (the frame is about 950 ms, GPU about 250 ms median); each one contains compute pipelines, for example one list with 37 compute pipelines took 650 ms and 8 lists with 3 compute and 5 mesh pipelines took 3085 ms. Find which pipelines (by the hashes in the log line) and which dispatches make them slow (dispatch size, loops that hitVIPORT_SHADER_LOOP_LIMIT, uncoalesced reads), and say why; a written finding with numbers is a valid result. Area: GPU compute. Difficulty: hard. Related: T5, T10. owner: unclaimed - T21 Video memory is over the budget: the
video memorylog line shows 12.4 GB in use of a 10.9 GB budget (113-122%) in the world scene, while thehost texturesline shows about 10.5 GB of host textures of which only about 3.8 GB were ever used by a list (about 6.7 GB never).MakeResidentandEvictare ignored (crates/viport-gpu/src/device.rs, slots 0x110 and 0x118) and nothing manages residency. Find out whether the over-commit costs GPU time (a run that skips three culling pipelines stays at 100% of the budget and its frame is a third shorter, but that is one data point), then try one of: create the host texture of a title texture on its first use by a list, or evict textures not used for N frames and make them resident again before the list that uses them (every GPU use of a host texture must go through that point: transitions, heap views, copies and uploads). A measurement with and without a smaller footprint is a valid result. Area: GPU host (resource.rs,host.rs). Difficulty: hard. Related: T5, T20. owner: unclaimed - T22 Isolated GPU timing of the three culling compute shaders. Caveat: the title's root layout and its buffers are not in the shader container, so a run on synthetic data (random or zero buffers) exercises early-exit paths and is only a rough bound, not the in-game cost; pair it with the real group counts from T23. Method: translate them from the title's shader pack (hashes 9f017d9011377efa, 9146291b38ea9ce1, 3b471c122be79b3e;
viport translate --list,translate_with_resourcesgives the host shader and its used resources), run each through the harness incrates/viport-shader/src/emit/host.rs(Host::dispatch, pattern inbvh_tests.rs), time it at 1, 64, 1024 and 16384 groups on a real GPU (WARP numbers are not representative). An earlier single-run comparison that suggested skipping these passes saves about 300 ms was within run-to-run noise (see T23) and is withdrawn. Area: viport-shader tests. Difficulty: hard. Related: T20, T23. owner: unclaimed - T23 Real dispatch sizes per frame: done on 2026-11-26 (diagnostics build prints, every five seconds, the six compute pipelines with the most thread groups per frame). In the world scene the largest are four pipelines with 3 dispatches of about 57,000 to 115,000 groups each (172,000 to 345,000 groups per frame) and one with 60 dispatches of 3,072 groups; the three culling pipelines named in T22 are not among the top six by groups, so their cost is not the group count. Important caveat for every performance task: on a fully warmed cache the same configuration gave world-scene frames of 552, 1055 and 1441 ms in three runs (median of the 3-6 five-second windows of each run), so a single run cannot show a difference of less than a factor of two; compare at least three runs per variant on a warm cache, and warm the shader cache and the pipeline library to 100% first. Skipping the five pipelines with the most groups gave 757, 842 and 2008 ms, which overlaps the base: no effect shown. Area:
crates/viport-gpu/src/draw.rs(diagnostics). Related: T20, T22. owner: maintainer, done
Shader translation
- T8 About 38 shaders warn
does not translate: run the translation (viport translate, seeREADME.md), group the refusal messages by reason, and open one issue per reason with the instruction or pattern involved (no shader dumps). Area: viport-shader. Difficulty: medium. Related: T6. owner: unclaimed - T9 Fix one translation refusal found by T8, with a synthetic test. Area: viport-shader. Difficulty: medium. owner: unclaimed
- T10 Mesh and wave64 shaders on 32-lane hosts: run with
VIPORT_MESH64_ON_32=1andVIPORT_D3D12_DRED=1on a 32-lane GPU, report which pipelines hang or remove the device (first lines of the DRED report), with GPU and driver. Area: viport-shader and GPU. Difficulty: medium. Related: Tracking: what is merged into V2 and what is not #2. owner: unclaimed - T11 Port the NVIDIA stack bundle (upstream #1638, wave64 compute and the world-run list) in pieces onto the current
main: one piece per pull request, starting with the part that conflicts least. Area: GPU and shader. Difficulty: hard. Related: Tracking: what is merged into V2 and what is not #2. owner: unclaimed - T12 Arithmetic tests against hardware semantics: add a hardware test (compare the translated result with the GPU result) for one instruction family that has none, in the style of the tests in
crates/viport-shader/src/emit/. If a row differs on your GPU, say which one. Area: viport-shader tests. Difficulty: easy to medium. Related: closedarithmetic_matches_the_hardware:v_fma_legacy_f32/v_fmac_legacy_f32differ from the model on one GPU #18 for the pattern. owner: unclaimed
Hardware and OS reports
- T13 Report from an AMD GPU: fill the form in Hardware reports: how far it gets on your machine #4 (how far it gets, frame time, first lines of the error). Area: report. Difficulty: easy. Related: Hardware reports: how far it gets on your machine #4. owner: unclaimed
- T14 Report from an Intel GPU (Arc or integrated): same form in Hardware reports: how far it gets on your machine #4. Area: report. Difficulty: easy. Related: Hardware reports: how far it gets on your machine #4. owner: unclaimed
- T15 Report from an NVIDIA GPU other than an RTX 5070 (for example a GTX 1660 or an RTX 30/40 card), and one from Windows 10 versus Windows 11 if you can. Area: report. Difficulty: easy. Related: Hardware reports: how far it gets on your machine #4. owner: unclaimed
Stability
- T16 Count the
physical pages could not be writtenwarnings in a run of at least 90 s on your GPU and post the counts and thefirst=... zero_in_list=...summary (commands in Growing dstorage failures in a run: physical pages could not be written #15). Zero is a useful answer. Area: report. Difficulty: easy. Related: Growing dstorage failures in a run: physical pages could not be written #15. owner: unclaimed - T17 Why does the dstorage failure count differ between runs (0 to 334)? Add a measurement of when the page list is filled relative to the read (for example the time between the read start and the first non-zero page), then decide if a longer wait or a retry of the failed request is worth it. Area: viport-hle (
dstorage.rs). Difficulty: medium. Related: Growing dstorage failures in a run: physical pages could not be written #15. owner: unclaimed
Docs and tests
- T18 Take one small pull request from the not-yet-merged list in Upstream pull requests not yet merged into main #12 (the ones closed upstream without a merge are the easiest), port it onto the current
mainwith its test, keep the original author's commit, and open one pull request for it. Area: any. Difficulty: easy to medium. Related: Upstream pull requests not yet merged into main #12, Coordination: single upstream pull requests outside the bundles #3. owner: unclaimed - T19 Docs:
README.mddoes not listVIPORT_PROFILE,VIPORT_ASYNC_SUBMITandVIPORT_PIPELINE_WORKERS(they are defined inprofile.rs,host.rs,pipeline/make.rs), and its "How you can help" table still points to the closed issuesa_title_image_name_is_in_the_ansi_code_pagefails on a non-1252 Windows code page #16,counter_enum_matches_array_lengthis stale:TexChangedis not the last counter #17,arithmetic_matches_the_hardware:v_fma_legacy_f32/v_fmac_legacy_f32differ from the model on one GPU #18. Add the three variables to the table and point the table at this board. Area: docs. Difficulty: easy. owner: unclaimed
Activity
DesertGamer commentedon Nov 25, 2026
I take T3 (the submission path waits for the previous submission to land; making
VIPORT_ASYNC_SUBMIT=1safe and effective). Work in progress: submissions that carry texture uploads now go through the landing thread too, and the waits for a submission in the air are narrowed to the buffers and title memory it actually touches. Please do not start the same change; reports of frame time and any device removal withVIPORT_ASYNC_SUBMIT=1on other GPUs are welcome here.DesertGamer commentedon Nov 25, 2026
T3 result (2026-11-26, RTX 5070): the remaining wait of the async submit path is a real data dependency, not an over-wide footprint. In a 110 s world run
Air::gatewaited about 200-400 times, never because of an open-ended footprint (open=false, 3 ranges of a few KB to 32 KB), always because the next submission refreshes title memory that the submission in the air writes back (copy-back of GPU-written data). A narrower footprint will not remove those waits; to go further the copy-back itself has to shrink (see T1 and T4: fewer and smaller copies per submission) or the title's reads of GPU-written memory have to be served from the host copy without waiting. Frame time withVIPORT_ASYNC_SUBMIT=1stays about 950 ms (GPU about 250 ms), so I am not turning it on by default. T3 stays with me for the cleanup; T1 and T4 are free and are now the better places to help.DesertGamer commentedon Nov 25, 2026
T20 finding (2026-11-26, RTX 5070, 110 s world runs,
VIPORT_MESH64_ON_32=1 VIPORT_WAVE64_ON_32=1): three compute pipelines account for a large part of the GPU time. They are the meshlet-culling passes (arguments init, meshlet cull, pre-skinned meshlet cull; shader hashes9146291b38ea9ce1,3b471c122be79b3e,9f017d9011377efa). They appear in the slowest submissions (3085 ms and 660 ms withVIPORT_GPU_TIMING=1). Skipping just these three withVIPORT_SKIP_PIPELINES=<hashes>cuts the scene frame from about 950 ms to about 630 ms and the GPU median from about 254 ms to about 160 ms, with no device removal (the meshes they feed are not drawn, so this is a measurement, not a fix). The next step for T20 is to find why these three are slow: dispatch size (number of meshlets), loops in the translated code, or the 64-lane to 32-lane split. Still unclaimed.DesertGamer commentedon Nov 25, 2026
T20 follow-up: the loop-limit and wave64 suspicions are not it. Disassembling the translated DXIL of the three meshlet-culling shaders (
dxc -dumpbin): none of them has a loop that reachesVIPORT_SHADER_LOOP_LIMIT(no iteration counters compared with 16384); all have 64-thread groups; the heaviest one (3b471c122be79b3e) is straight-line code of about 9500 lines with 160 branches, roughly 670 arithmetic ops, 189 raw buffer loads, 65 texture loads (a depth-pyramid test) and 5 atomics; the pre-skinned one (9f017d9011377efa) has 16 barriers and 7 atomics; the arguments-init one (9146291b38ea9ce1) is 120 lines and trivial. So the cost has to come from how many groups are dispatched or from the memory they touch (the buffer views go through our host copies of title memory), not from the shader code itself. Next step for T20: log the dispatch dimensions of these three per frame (VIPORT_D3D12_DREDtraced frame, or a counter in the dispatch path) and the size of the buffers they read. To reproduce the disassembly:VIPORT_TRANSLATE_ONLY=<hashes> VIPORT_EMIT_DUMP=<dir> viport translate <shader archive> --list, thendxc -dumpbinon the files (do not post the dumps).README: list VIPORT_PROFILE and VIPORT_PIPELINE_WORKERS, point Help w…
Merge pull request #41 from lcg007xd-c/docs/t19-readme-board
DesertGamer commentedon Nov 25, 2026
Maintainer update, 2026-11-26.
cargo test --workspace(xtask policy:lower.rsover the size limit); chore(shader): move lower.rs unit tests into emit/lower_tests.rs to satisfy asset policy #27 fixes that.DesertGamer commentedon Nov 25, 2026
Maintainer update, end of the pull request batch (2026-11-26): every open pull request except #14 is merged into main (#21-#45, shader pull requests included). Checks on the merged tree:
cargo clippy --workspace --all-targets --locked -- -D warningsclean in both feature sets,cargo test --workspace --locked978 passed, 0 failed, and a 130 s world run on an RTX 5070 reached the scene with no device removal and no errors (frame about 810 ms, GPU 140 ms; before the batch about 950 ms). #14 stays open: its speedups did not reduce frame time on our measurements, details in the pull request.DesertGamer commentedon Nov 26, 2026
I take T1 and T4 (maintainer, 2026-11-26): find and cut what a submission repeats while it prepares title memory for the GPU (shader write declarations, texture heap walks, the copy-back compare). Work is on
main-v3; numbers before and after will be posted here. Please do not start the same cuts.DesertGamer commentedon Nov 26, 2026
T1/T4 result (2026-11-26, RTX 5070, 32-lane, world scene, warm shader cache,
VIPORT_PIPELINE_WORKERS=16 VIPORT_MESH64_ON_32=1 VIPORT_WAVE64_ON_32=1). Pushed as e637e6b31. Full workspace tests and clippy (both feature sets) pass on a clean copy of that commit.What was repeated:
b32fb99of avatarmanz/VIctory-7900XTX).bindless::uploadsvisited every texture of every heap twice: about 100 thousand textures per frame (about 3,000 per submission, about 35 submissions), to find the 100-300 whose memory changed. A pass that recorded nothing is now remembered with the count of writes to tracked texture memory and the number of heap views, and the next submissions skip the walk while both are unchanged and nothing is in flight (at most 8 in a row).Numbers (medians of the scene windows of single runs, 7-28 windows each; the runs were not on the same code state, so read them as a direction): CPU preparation about 560 ms to 410-430 ms; heap texture uploads 148 to about 118 ms; scene frame about 1000 ms to 680-810 ms (best window 302 ms).
30 fps is not reached. Left in a heavy window of the last run: refresh batches 287 ms (about 120 ms of it not explained by snapshots, guards, watches and copies), heap texture uploads 132 ms, descriptor sync 133 ms (103 ms of it making 17.8 thousand views), copy-back 75 ms, GPU about 150 ms.
Ruled out (so nobody repeats them): slow copies are not disk reads (no correlation between
movestime and page-ins over a whole run, 13 GB free);Air::gateis cheap (243 thousand calls, 8 ms); the copy-back compare is not the bottleneck (see 3).New counters in the
copies per frameline (diagnostics build): gate and settle waits, heap texture passes (visited, skipped, recorded), repeated declarations, range statistics and coalescing inside a flush.DesertGamer commentedon Nov 26, 2026
Where the time goes, and directions for the open tasks (2026-11-26; our own measurements on an RTX 5070, world scene, single runs, so read them as orders of magnitude).
root_viewindraw.rs), whatever the shader does. A per-shader flag "stores through this UAV", computed while lowering, would let read-only users skip the snapshot and the compare. A shader that marks the pages it wrote would remove the snapshot altogether (larger change).e8fd20f85; a merge lost it, not restored yet).Ask here if you take one.
DesertGamer commentedon Nov 26, 2026
Finding for anyone looking at "give the GPU the title's memory in place" (2026-11-26, RTX 5070, a small standalone D3D12 probe, not the game). Short version: it opens, but it is not a drop-in replacement for the shadow copies.
What works:
ID3D12Device3::OpenExistingHeapFromAddressaccepts ordinaryVirtualAllocmemory (256 MiB tested). The heap comes back asCUSTOM, write-back, pool L0, withSHARED_CROSS_ADAPTERamong its flags, so a buffer placed on it must be created withD3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER; without that flagCreatePlacedResourcereturnsE_INVALIDARG.What breaks it:
VirtualProtect(PAGE_GUARD,PAGE_READONLY) andVirtualFree(MEM_DECOMMIT)on pages of that region fail with error 87. The same three calls on memory that never went into a heap succeed (control in the same run). They kept failing after the probe released its resource and heap in the same process, so the release is deferred or the region stays pinned longer; we did not wait to see for how long.For scale, in our world-scene profile the CPU copy of changed pages plus the fallback read path is roughly 100 ms of a ~760 ms frame, so even a complete success of this route would remove at most about a seventh of it. We are not pursuing it now; if someone's title never reprotects those regions, it is worth re-running the probe against that.
ForsunJay commentedon Nov 26, 2026
I take T21.
Why: on an RTX 5060 Ti with 8 GB (DXGI budget about 7 GB) the over-commit is not just slower, it ends in a device removal while the world loads: host textures reach 9.4 GB, of them about 440 MB used by lists, video memory at 140 % of the budget. Report with numbers in #4.
Plan: first check how much of the never-used memory is really never read (the
usedcount comes from list transitions, so textures read only through heap slots may be missing from it), then make a title texture's host texture on first use, behind an opt-in variable first, and measure on this card with and without it.DesertGamer commentedon Nov 26, 2026
T1/T4:
1f628266fis on main. World scene, async submissions, RTX 5070, one run, medians of 8 windows (windows differ by place in the world, so read the numbers as orders of magnitude).What changed:
Where a ~750 ms frame blocks while it prepares (ms per frame):
Of the ~134 ms in the update flush gate, ~110 ms were ranges with no page the title changed under them (nothing to copy, so nothing to wait for) and ~8 ms were ranges with one.
Next on T1/T4: skip those unchanged ranges (measured once: flush wait 134 -> 42 ms, not on main yet), then look at the list reset.
DesertGamer commentedon Nov 26, 2026
T1/T4:
11f539cc6is on main (withce4f2eb22). World scene, async submissions, RTX 5070, one run, medians of 8 windows (windows differ by place in the world, so read the numbers as a direction, not a precise gain).Verification: clippy clean in both modes, 992 tests passed, no device removal in the run.
DesertGamer commentedon Nov 26, 2026
T1/T4 follow-up. Scene frame is still ~680 ms (best run), target 500 ms is not reached. New measurements: the wait before ExecuteCommandLists is 80-85% waiting for the GPU to finish the submission in the air (172 of 205 ms in the worst window) and only 13-33 ms of landing work, so overlapping submissions can hide at most that much and was dropped. Per-pipeline GPU time (new diagnostics, pushed): two compute shaders take 36% of the world-load window (about 1 ms per dispatch, 233 dispatches per 5 s each); the steady scene shows no single dominant pipeline (heaviest mesh ~79 ms, texture copies ~61 ms per 5 s window), then a long tail. Run-to-run spread is large (617-946 ms for the same code), so gains below ~100 ms cannot be shown from one run. Two bindless tests (heap_views_*) fail in parallel test runs on any commit and pass single-threaded; separate issue.
DesertGamer commentedon Nov 26, 2026
Fixed a real bug found while checking CI: the process-wide 'clean' stamp that lets a submission skip the heap texture upload did not name the heaps it was set for, so a list of other heaps with a registered but not yet uploaded texture was skipped for up to eight submissions (its shader read a zeroed host texture). It also made two bindless tests fail in every parallel test run. The stamp now names its heaps. Full CI is green in parallel mode (992 tests). Scene frame is unchanged at ~680 ms; no frame-time effect was measured for this fix.