Skip to content

GPU: the dropped passes a presented image reads go first in the pipeline queue - #3378

Open
neonbyte1 wants to merge 7 commits into
Marvisak:mainfrom
neonbyte1:fix/hurry-feeders
Open

neonbyte1 wants to merge 7 commits into
Marvisak:mainfrom
neonbyte1:fix/hurry-feeders

Conversation

@neonbyte1

Copy link
Copy Markdown

Stacked on #3353 (fix/hold-unwritten-frames, df15a809); only the last commit (dba19ba2) is new here.

What is wrong

#3353 fixes the flicker while pipelines are still being made: a dropped draw into the presented image holds the frame and its pipeline goes to the head of the workers' queue. A dropped pass further back still leaves the image wrong, because the image is then written from stale inputs.

Grand Theft Auto VI's world on a cold driver cache (__GL_SHADER_DISK_CACHE=0 VKD3D_SHADER_CACHE_PATH=0, RTX 5090, Wine + vkd3d-proton) first binds ~1,900 pipelines in one frame. With #3353, the final upscale is made at once. But the world then stays black (brightest probed pixel 0–1 of 255) until the compute pass that resolves the lighting (structure_lod_wetness:CS_RaytracingResolve) is made. That pass waited 47–54 s in the queue in three runs, and then took 5.8–6.1 s to build. The image turns bright on the first frame after both pipelines exist, while ~1,000–1,700 others are still queued.

What changes

While pipelines are queued, each frame notes:

  • for passes that run: what each reads and writes (the views its code uses through tables, its render targets and depth);
  • for passes that are dropped: what each would have written:
    • its targets;
    • the unordered views its code names through tables. These come from the container's own resource records, so no translation is needed.

At the present, a walk goes back from the presented images through passes that ran. It finds the dropped passes whose writes those passes read, and the nearest ones go to the head of the workers' queue (crate::feeds). Once a hurried pass runs, a later frame's walk goes on behind it.

The walk must not take the world's content. A first version did: one round put 666 mesh pipelines first and pushed back 103 pipelines the queue would have made within 15 s (a TAA resolve, a tiled-lighting clear, decal and particle compute). The world went dark again for about a minute. Hence three limits:

  • Reads are kept per pass, not per pipeline. A pipeline many passes share (a blit) would otherwise join every one of their inputs.
  • A resource with more than 4 dropped writers is not followed to them (FAN_IN_MAX). One or a few passes (a resolve, lighting) leave a resource stale; hundreds of draws into depth or a geometry buffer leave objects missing. The walk still goes through such targets' passes that ran.
  • At most 8 pipelines per present (HURRY_MAX), nearest first. Only pipelines that can still be hurried count toward the 8: queued, not taken by a worker, not hurried before.

The first 64 pipelines a run hurries (FIRST_MAX) are listed in first-pipelines.txt, beside early-pipelines.txt. The next run starts them ahead of the other early starts, during loading.

The code names no shader.

Measured

All runs below use the same cold-cache setup, one 480 s run each, and the same diag build family. "+s" is the time since the scene's first frame.

blk-cold-hold (#3353 only) hurry3 (this PR, no list) hurry4 (this PR, list from hurry3)
made first rounds — at most 8 pipelines per round —
TAA temporal resolve made +11.8 s +11.7 s —
tiled-lighting clear made +6.3 s +6.5 s —
final upscale hurried at its first draw hurried at its first draw made in advance, never waited for
lighting resolve made 53 s after its first bind made ~6 s after its first bind made ~6 s after its first bind
frames 1300/1303 0.2 (black) 93 / 137 (the "NINE MONTHS AGO" intertitle visible) —
black-frame warnings 3 4 (1, 983, 1291, 1301) 4
held frames 1 1 2 (boot image, frames 6/8)
first-pipelines.txt — 63 entries 64 loaded
  • Same queue order as without the walk. hurry3 makes the TAA resolve and the lighting clear at the same times as blk-cold-hold, so the narrowed walk no longer starves the queue.
  • The lighting resolve still takes its build time. In hurry3 the title bound it only at +53 s (it reached that scene late). It was hurried at once and made 6 s later. hurry4 shows the same, because hurry3 never hurried it, so it is not in the list.
  • Not a full A/B. The title's own timing differs between runs, so frame numbers of scene changes are not comparable one to one.
  • Black-frame counts. The diagnostics detector only sees frames that are shown; held frames are never counted.

Limits

  • Buffers and views a shader indexes in the heap itself are not followed; only descriptor-table views and targets are.
  • A pipeline first bound only after the backlog (the lighting resolve in hurry3/4) is hurried at once but still takes its build time. The list only helps pipelines a run actually hurried.
  • With the list loaded, a boot-screen pipeline was held for 2 frames: it was hurried early and the hold waited for it. The hold limit (10 s, GPU: a frame whose presented image a dropped draw left unwritten is not shown #3353) bounds this.
  • Passes are taken per frame in the order they were recorded on any thread. A pass may be counted as feeding the image even though it runs after the read; that only moves a pipeline ahead in the queue.

Cost

When nothing is queued (a warm run, or once the queue drains):

  • Per bind: one relaxed atomic load and a thread-local flag.
  • Per view and per pass that runs: a flag test. No lock, no map.
  • Per dropped pass: one OnceLock::get. Refused pipelines stop there. A container's resource records are parsed only for pipelines being made, once per container.
  • Per present: one uncontended lock and mem::take of an empty graph, which allocates nothing.

While pipelines are queued:

  • Recording: one mutex per pass that runs, and set inserts per view and target.
  • The walk: once per present, only if a dropped pass was noted.
  • Memory: everything is per frame. The graph is dropped at each present and capped at 2^20 notes per frame (NOTES_MAX). first-pipelines.txt is capped at 64 keys.

Tests

CPU only, under Wine; they create no D3D12 device.

  • feeds::tests:
    • the_dropped_passes_a_presented_image_reads_are_found_nearest_first (including the second round once the resolve runs)
    • nearer_feeders_come_first
    • the_image_s_own_writer_and_writeless_passes
    • a_cycle_ends
    • a_target_many_dropped_draws_write_is_not_followed
    • a_shared_pipeline_s_passes_are_followed_apart
    • notes_are_capped
  • pipeline::library::tests:
    • the_first_list_keeps_this_run_first_under_its_cap
    • a_run_lists_its_first_hurries_only
  • Together with the existing shown, pipeline::make and early-list tests: 20 passed.
  • cargo clippy -p victory-gpu --all-targets --target x86_64-pc-windows-msvc -- -D warnings, with and without --all-features: clean.
  • Not run on Windows; CI runs the Windows tests.

Related

AI-assisted (Claude); measured on my machine, no game data shared.

…ot shown

A draw whose pipeline is still being made is dropped and leaves its
targets as they were. When it is the draw that writes a presented image
(Grand Theft Auto VI's final upscale, PS_TAA2_SpatialUpscaleWithDithering),
that back buffer still holds the frame drawn into it two presents ago, and
the window alternates between two old frames. On a cold driver cache the
world's first frame wants ~1,900 new pipelines; the upscale's was made 41 s
after its first use, and frames 1300-1346 alternated black and dim.

Such a draw now puts its pipeline at the head of the workers' queue
(make::hurry), and a present of an image it left unwritten is not shown:
the window keeps the last frame shown (crate::shown), for at most 10 s
(HOLD_LIMIT). Past that the frames are shown as they come, and the log
names the pipelines waited for, so a pipeline that never arrives (a dead
worker, a hung driver compile) cannot freeze the window. Refused pipelines
do not count at all. VICTORY_SHOW_UNWRITTEN=1 shows those frames as before.
…ine queue

With Marvisak#3353 a dropped draw into the presented image holds the frame and
puts its pipeline first. A dropped pass further back still leaves the
image wrong: in Grand Theft Auto VI's world on a cold driver cache the
final upscale was made at once, but the world stayed black for ~50 s
until the compute pass resolving the lighting (CS_RaytracingResolve) was
made: it waited 47 s in the queue behind ~1,900 pipelines first used in
the same frame, and took 6 s once a worker had it.

While pipelines are queued, each frame now notes what each pass that runs
reads and writes (the views its code uses through tables, its targets)
and what the dropped ones would have written: their targets, and the
unordered views their code names through tables, read from the
container's own resource records (no translation needed). At the
present, a walk back from the presented images through the passes that
ran finds the dropped passes whose writes they read, and the nearest
eight go to the head of the workers' queue (crate::feeds). Once a
hurried pass runs, a later frame's walk goes on behind it.

The walk must not take the world's content: reads are kept per pass, not
per pipeline (a blit used by many passes would join all their inputs),
and a resource with more than four dropped writers (depth, a geometry
buffer, filled by hundreds of draws) is not followed to them. Without
these a round put 666 mesh pipelines first, pushed back 103 that the
queue would have made within 15 s, and the world went dark again.

The first 64 pipelines a run hurries are listed in first-pipelines.txt
beside the early list; the next run starts them ahead of the other early
starts, during loading.
@neonbyte1

Copy link
Copy Markdown
Author

CI note: the one failing test, frame::tests::waits_end_on_ticks_and_count_frames (frame.rs:231, a zero-time-out wait got S_OK instead of TIMEOUT), is the known flaky frame-clock test. #2861 and #2877 describe exactly this line: 2 ms ticks on a loaded runner, plus the test sharing the global clock with waits_begun_together_take_different_ticks. This PR doesn't touch frame.rs, and the other 246 victory-gpu tests passed, including the new feeds::, shown:: and pipeline::library:: ones. #3353, with most of the same code, passed CI twice. I can't re-run the job from a fork; a maintainer re-run should clear it.

AI-assisted (Claude); no game data shared.

@Dukestar69 Dukestar69 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — verified on RTX 5090 (Windows / D3D12) against origin/main (63bcca4).

  • Prioritizing dropped feeder passes whose outputs feed the presented image (nearest-first, cycle-safe, and capped) works cleanly alongside shown and the pipeline worker queue.
  • cargo test -p victory-gpu --lib feeds:: -- --test-threads=1: 7 passed, 0 failed.
  • cargo test -p victory-gpu --lib shown:: -- --test-threads=1: all passed.
  • cargo test -p victory-gpu --lib pipeline:: -- --test-threads=1: all passed.
  • cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20 passed, 0 failed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.
  • cargo xtask policy: 193 files ok.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

@fuzeofficlal fuzeofficlal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pass-level feeder graph (feeds.rs), FAN_IN_MAX/HURRY_MAX bounds, lock-free warm fast path, and first-pipelines.txt persistence are cleanly designed and well-tested (all 62 feeds/shown/pipeline/draw tests and strict clippy checks pass on both RTX 5090 and WARP with VICTORY_D3D12_DEBUG=1).

However, auditing the new hooks turned up one live crash bug and two graph-tracking bugs that should be fixed before merge:

1. Blocking: State::not_made dereferences unchecked descriptor table pointers without self.heap_of (crates/victory-gpu/src/draw.rs:628-633)

for u in uavs {
    if let Some(&Root::Table(table)) = self.roots_ref(compute).get(usize::from(u.slot))
        && let Some(View::Unordered(resource, _, _)) =
            crate::descriptor::view(table + u64::from(u.table_offset_dwords) * 4)
    {
        writes.push(resource);
    }
}

Unlike State::table_entry (draw.rs:1236) and State::tables (draw.rs:1270, 1297), which always verify self.heap_of(handle) before reading title descriptor memory, State::not_made computes table + u64::from(u.table_offset_dwords) * 4 directly and passes it to descriptor::view(handle). Inside descriptor::view (descriptor.rs:558-563), any non-zero handle is immediately dereferenced via (handle as *const [u32; 3]).read_unaligned().

If a title binds a null root table (Root::Table(0)), has no bound view heap, or leaves a stale root table handle from an earlier released/unmapped heap, and u.table_offset_dwords > 0, table + offset produces a non-zero invalid address (e.g. 0x20) and immediately crashes with an access violation. (Unchecked table + offset can also overflow u64.)

  • Reproduced live on Windows: calling state.not_made(true) on a pending compute pipeline (being_made == true) with one table UAV at table_offset_dwords = 8 and state.set_table(true, 0, 0) crashed the child process with 0xC0000005 (STATUS_ACCESS_VIOLATION).
  • Fix: validate with checked_add and self.heap_of(handle):
    if let Some(&Root::Table(table)) = self.roots_ref(compute).get(usize::from(u.slot))
        && let Some(handle) = table.checked_add(u64::from(u.table_offset_dwords) * 4)
        && self.heap_of(handle).is_some()
        && let Some(View::Unordered(resource, _, _)) = crate::descriptor::view(handle)
        && resource != 0
    {
        writes.push(resource);
    }

2. Null SRVs / UAVs (resource == 0) create a phantom hub node in feeds::Graph (crates/victory-gpu/src/draw.rs:632, 1928-1936, crates/victory-gpu/src/feeds.rs:81-105, 166-195)

descriptor::create_srv(NULL, ...) and create_uav(NULL, ...) record View::Shader(0, _) and View::Unordered(0, _, _). While feeds::ran and not_made carefully skip depth == 0, neither readable, not_made, nor feeds filters out resource == 0 (nor 0 in targets/writes).

Because Graph::ran[0] has no FAN_IN_MAX cap, any pass feeding a presented image that binds a null SRV (0) walks through Graph::ran[0] into every unrelated ran pass that bound a null UAV (0), pulling unrelated dropped pipelines into the priority queue.

  • Reproduced in feeds::tests: g.dropped(99, || "unrelated_dropped", &[unrelated_tex]); g.ran(&[unrelated_tex], &[0]); g.ran(&[0], &[image]); returns feeders = ["unrelated_dropped"].
  • Fix: ignore 0 resources in feeds::view, feeds::ran (targets), and feeds::dropped (writes) (or inside Graph::ran/Graph::dropped).

3. Graph::ran bypasses NOTES_MAX when writes.is_empty() (crates/victory-gpu/src/feeds.rs:81-91)

When a pass runs with writes.is_empty() (e.g., a bindless/root-view-only compute dispatch), its index is never inserted into self.ran, so self.reads.push(...) stores an unreachable entry; when reads.is_empty() as well, self.notes += 0 never increments, letting self.reads grow past NOTES_MAX unboundedly if presenting pauses while pipelines are queued (10_000 calls -> notes = 0, reads.len() = 10_000).

  • Fix: early-return in Graph::ran with if writes.is_empty() || self.notes >= NOTES_MAX { return; } (mirroring Graph::dropped at line 96).

Review of Marvisak#3378 (fuzeofficlal): three bugs in the hooks that note what a
frame's passes read and write.

State::not_made read a table UAV with `table + offset * 4` computed
directly and handed to crate::descriptor::view, unlike table_entry and
tables, which check self.heap_of first: a title binding a null root table
(Root::Table(0)) with a non-zero table offset dereferenced a bogus
address and crashed the child with 0xC0000005. The handle is now a
checked_add that a bound heap must hold, so a null, stale or out-of-heap
table names nothing. A null descriptor names nothing either.

A null view (resource 0) made a phantom hub: a pass that bound a null SRV
joined every pass that bound a null UAV, so an unrelated dropped pass
whose writes nothing presented reads was pulled to the head of the
queue. `feeds` now ignores 0 in reads, writes and targets, at the pass
and in the graph.

Graph::ran noted a pass that wrote nothing, which no walk can reach: its
reads grew past NOTES_MAX while notes stayed put (10,000 writeless
passes, notes 0), for a title that stops presenting while pipelines are
queued. It now returns at once, as Graph::dropped did, and excludes
null descriptors from its counts.
@neonbyte1

Copy link
Copy Markdown
Author

@fuzeofficlal thank you for the audit and the live repro; all three are fixed in d6c32b0, a follow-up commit:

  1. The crash in State::not_made: the write computation moved into State::would_write, so it's testable without a device. A table entry is now read only after table.checked_add(offset * 4) succeeds and self.heap_of(handle) confirms a bound heap holds it, and a View::Unordered(0, ..) is skipped. Null targets are filtered too. It was the only new read of title descriptor memory in this PR; table_entry, tables and the diagnostics probes already gate on heap_of. New test: draw::tests::a_dropped_pass_reads_no_descriptor_it_cannot_name. It covers Root::Table(0) at an 8-dword offset (your 0xC0000005 case), a stale handle whose offset overflows, and a root-descriptor UAV. State::default() binds no heap, so a stray read would fault in the test process.
  2. Null resources: feeds::view no longer stores 0, and Graph::ran/Graph::dropped ignore 0 in reads, writes and targets. New test: feeds::tests::a_null_view_feeds_nothing, your three calls, now with no feeders.
  3. NOTES_MAX: Graph::ran returns at once when the pass wrote nothing non-null, like Graph::dropped, and counts only what it keeps. It filters in place, so there's no allocation per pass. New test: feeds::tests::a_pass_that_wrote_nothing_is_not_noted (10,000 writeless passes: no reads kept, notes stays 0).

Tested under Wine (CPU-only): feeds:: 9/9, shown:: 6/6, pipeline::make:: 3/3, plus the new draw test. Clippy -D warnings, default and --all-features, policy and formatting are clean.

AI-assisted (Claude); no game data shared.

@fuzeofficlal fuzeofficlal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three issues from the previous review are cleanly resolved in d6c32b03:

  • State::would_write (crates/victory-gpu/src/draw.rs:634-667) now validates descriptor table handles with table.checked_add(u64::from(u.table_offset_dwords) * 4) and self.heap_of(handle).is_some() before calling descriptor::view(handle), and filters out null targets (0) and null UAV resources (resource == 0), backed by draw::tests::a_dropped_pass_reads_no_descriptor_it_cannot_name (draw.rs:2126).
  • feeds::view (crates/victory-gpu/src/feeds.rs:176), Graph::ran (feeds.rs:87), and Graph::dropped (feeds.rs:105) consistently ignore resource == 0 in reads, writes, and targets, backed by feeds::tests::a_null_view_feeds_nothing (feeds.rs:321).
  • Graph::ran (feeds.rs:88) early-returns when a pass has no non-null writes and only counts retained entries toward NOTES_MAX, backed by feeds::tests::a_pass_that_wrote_nothing_is_not_noted (feeds.rs:336).

Verification on origin/main (63bcca43):

  • cargo xtask policy: ok (193 files ok)
  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (default and --features diagnostics): clean
  • cargo test --locked -p victory-gpu --features diagnostics -- feeds:: shown:: pipeline:: draw:: --test-threads=1 with VICTORY_D3D12_DEBUG=1: 65/65 passed on RTX 5090 and 65/65 passed on WARP
  • Re-ran the prior crash/null-hub/NOTES_MAX probes (Root::Table(0) + 8-dword offset, u64::MAX - 16 overflow, null target filtering, and 10,000 empty/null-write passes): all passed cleanly.

@passerbyyhx

Copy link
Copy Markdown

I ran a two-frame Windows CPU probe on head d6c32b03d20c916277315230d6062d70225a98e6 and its direct parent dba19ba20a94628fdc95cb209cd22ff0bdf2e46d. It uses the real present-time feeder path and a real pipeline worker paused immediately after it claims an item.

  • In frame 1 the worker already had the nearest candidate (0). Both builds promoted exactly eight remaining feeders, 1 through 8 in nearest-first order. Feeders 9 through 11 stayed in the ordinary queue.
  • In frame 2 head promoted 11, 10, and 9 in their new nearest-first order, preserving the ordinary FIFO order of 12 and 13. The already-taken candidate and the prior frame's stale graph contributed no promotions. The worker claimed all 16 items exactly once and drained the queue.
  • The parent failed the frame 2 assertion because a write to resource 0 promoted unrelated candidate 14 ahead of 11, 10, and 9.

The probe uses synthetic pipeline identities and covers scheduling without GPU execution.

Synthetic test fixture

AI-assisted with Codex.

@neonbyte1

Copy link
Copy Markdown
Author

@passerbyyhx thank you, that's a valuable check. It goes through the real present-time path and a paused worker, which my unit tests don't. Head promoting 8 feeders nearest-first per frame, keeping the ordinary FIFO order, and claiming every item once, while the parent lets resource 0 promote an unrelated candidate: that's exactly the null-resource hub fixed in d6c32b0.

If you'd like, I can add your fixture (f40988b) to this PR as a regression test, with you kept as the commit's author. It covers the worker claim and the cap together, which feeds::tests only cover separately. Just say so, or open it as a suggestion and I'll take it as is.

AI-assisted (Claude); no game data shared.

@pickles976

Copy link
Copy Markdown

Verified d6c32b03d20c916277315230d6062d70225a98e6 on Linux/Wine11, RTX4060 Laptop8GiB (NVIDIA590.48.1),16GiB host RAM. Rust1.98.1 Windows-MSVC target; --features diagnostics --lib, one test thread, fresh Compiling victory-gpu (.../VIctory-pr3378/...) provenance (9.75s build).

  • feeds:::9/9 pass.
  • shown:::6/6 pass, including show-all and eviction.
  • placed_uav_dispatch_writes_its_texture:1/1 pass,0.72s, actual NVIDIA device/SM6.8. The sole local test-only edit replaces absent-host/SM6.6 skips with assertions; production unchanged. The fixture's dispatch counter, exact two-texel GPU readback and live-device check passed.

This uses our disclosed diagnostic relaxed-vtable vkd3d build 2576c0b4adfae4a+, not stock Wine certification or an independent WARP result. Each leg had9GiB memory/512MiB swap and180s deadline. Logs .compat-runtime/logs/verify-pr3378-20261127T062513Z-{feeds,shown,placed-uav}.log. No title trial or matched-parent verdict on this PR.

Coverage gap relevant to our black-scene investigation: our title path calls the native FidelityFX provider through external::record, with #1868/review85b26e8 packing its FP16 output into the title's RGB9E5 texture. This bypasses draw::State, so #3378's graph has no successful-pass edge from the original title colour/depth/motion identities to the original title output identity. external::record currently calls the closure and invalidates host state, but reports no graph reads/writes. The graph can therefore stop at that native boundary even though the physical GPU data path exists. This is source-level coverage evidence, not a claim that it causes our black frame.

Suggested owner extension: a bounded, success-only external-pass attribution API. Capture original title resource identities before the FFX copy is rewritten to host COM pointers; on native OK and after the bridge pack is recorded, connect non-null input slots0..5 to title output slot6. Avoid the draw TLS recorder, wrong host-pointer identities, and attribution on a refused/failed native call. Add an actual external-path regression where a dropped colour producer is found through native output→composite, with failure/null/alias cases.

For local integration I will preserve #3025's compute cap and the published #2223 registration-order fix from 335eb7b, rather than replace its scheduler with this branch's two-queue version. VICTORY_SHOW_UNWRITTEN=1 preserves feeder urgency while avoiding confusing held old frames with newly rendered content.

Our separate mixed-stack evidence is linked in #841:183/184 HDR-targeting keys observed available after selective prewarm, but two end-of-frame HDR snapshots still zero and the actual170s client black. At-dispatch input versus later overwrite remains unmeasured; screenshots/assets stay local.

@neonbyte1

Copy link
Copy Markdown
Author

@pickles976 thanks for the independent run on a 4060 under Wine, and for the coverage note.

You're right that external::record reports no reads or writes to the graph, so a walk back from the presented image stops at a native FidelityFX pass. On my setup that path isn't exercised: the runs have no FidelityFX DLLs (victory_hle::modules::fidelityfx: no FidelityFX folder), so the title's own passes do the upscale and the graph sees them. That's why I couldn't measure the gap or test a fix for it in game.

The extension you describe (success-only, title identities captured before the bridge rewrites them to host pointers, inputs 0..5 → output 6, nothing on a refused/failed call) fits the graph as it is. I'd rather keep this PR to what I can measure, but I'm glad to do it as a follow-up on top of #3378 with CPU tests for the edge cases you list (failure, null slot, aliased input/output), if someone with the native FidelityFX path can run the end-to-end check.

AI-assisted (Claude); no game data shared.

@pickles976

Copy link
Copy Markdown

Follow-up on the actual Wine/RTX 4060 Laptop title path: I integrated owner #3378 d6c32b03d20c916277315230d6062d70225a98e6 with the published #3353/#3025/#2223 scheduling combination andrewpozdnakov7-jpg/VIctory@335eb7baf2f1adc596e30eb641490205fed2fded onto our existing dirty memory/paging/Wave64/native-FFX stack, base 3ed7d725f6895fe1a235eb6fa8ff2485261ca151. This is a local mixed integration, not exact-head or main certification.

The native FFX bridge is outside ordinary State draw/dispatch tracking. I added a local success-only external-pass edge using the original title resource identities, recorded only after native dispatch and bridge output write are recorded. Failed dispatches create no edge. I used VICTORY_SHOW_UNWRITTEN=1 so a held prior image could not be mistaken for scene rendering.

Focused Windows-target Wine checks: scheduler10/10, feeder graph10/10 (including the new native edge), shown6/6, pipeline library13/13, builder2/2, actual placed-UAV GPU readback1/1, actual native FFX direct-FP16/RGB9E5 bridge1/1: 43 checks passed, not the full suite. Important fixture caveat: the first placed-UAV test returned zero pixels because its default emitter had view_pages=false while this runtime uses #2121 paged heaps. Adapting only the synthetic emitter to the production descriptor::view_pages() setting made the unchanged pixel assertions pass; production emission already used that setting. Initial failure retained in the logs, not attributed to #3378.

Fresh diagnostics release43.37s, same128-key selected early-start list, reported1920x1080/window1280x720, copy-only file-backed title memory, unchanged9GiB/512MiB scope and6000MiB GPU/2048MiB available-RAM/10GiB disk guards. The180s run time-stopped, exit137; no resource stop, no kernel entries during the interval. MaxGPU5025MiB, minimum availableRAM4498.8MiB, maxscope8504.8MiB, minimum availabledisk11.075GiB. Wine11/NVIDIA590.48.1, diagnostic-relaxed vkd3d 2576c0b4adfae4a+, not stock-stack certification.

Observed: loading illustration45s, dark transition90s, black window120/150/170s. The scheduler logged both direct-image and feeder promotions. Native FFX original resource IDs were logged; immediately-before input and immediately-after output at accepted dispatches1 and8 were raw RGB allzero, nonfinite0. Thus these samples remain black upstream of the native upscaler.

New exact status: an HDR-target graphics writer key 3e1221d183a0bae690bf40a7dde15927 (VS 8157a974717876a9, PS 3ded230430ee2590) was queued, not a shader refusal or unstarted state, at07:05:37.528599UTC. No later status transition or translation for those stages was logged. This is not sufficient root-cause proof: in an earlier trial this same writer became available and the final scene still stayed black.

The separate all-or-none BVH gate reports53 pipelines,51 made,2 refused,0 dropped. New named refusal diagnostics establish the two members: 5deed866470e17b4b7a9c37cd7448070 → compute caa78b8ca62bc3d6, and eacda2f272ababc3dc675212dcbfbb9f → compute 28918b7150a7aad5; both refuse LDS without a uniform fence in splitWave64. I have not bypassed that safety gate. This remains a separate scene blocker candidate, not proof that #3378 caused the black frame.

Local evidence: verify-feeder-integration-20261127T065706Z-{1..6}.log, verify-feeder-native-20261127T070051Z-{paged-uav,native-ffx}.log, feeder-ffx-trial-20261127T070256Z/{summary.json,pipeline-use.tsv.gz}, 20261127T070339Z-{console.log,resources.csv} under .compat-runtime/logs/. Captures/game assets stay local. Native-boundary context: #841 (comment) .

Next useful check: follow the exact queued HDR writer’s input/view identities through the dependency graph, and separately verify an owner translation correction for the two named BVH members. I will not repeat this unchanged180s trial or treat pipeline availability alone as rendered-world proof.

@neonbyte1

Copy link
Copy Markdown
Author

@pickles976 one data point on the two BVH members, in case it helps separate that blocker: on my RTX 5090 stack both translate and get a host pipeline in the current best build (caa78b8ca62bc3d6 and 28918b7150a7aad5: translated once each, one pipeline each, nothing refused). That stack handles one console wave sharing LDS through #439's console flow (groups up to 64 threads on 32-lane hosts) plus #2118, not through a split-wave64 path. So the "LDS without a uniform fence in splitWave64" refusal looks specific to the split-wave route; #439 + #2118 may be the quicker way to get those two built on your side (the BVH builder 28918b71… also crashed the title for me during loading before #2118).

Thanks for adding the external-pass edge and the all-zero samples before and after the native upscaler: that puts the black upstream of FFX, as you say.

AI-assisted (Claude); measured on my machine, no game data shared.

@pickles976

Copy link
Copy Markdown

Follow-up with a bounded, diagnostic-only trace on the same mixed Linux/Wine11 + RTX 4060 Laptop 8 GiB / 16 GiB system-RAM stack (not an exact-head #3378 verdict): fresh 31.59 s release, 128 early keys, unchanged resource guards, 180 s title ceiling. Loading at 45 s, black at 120/150/170 s; no recognizable scene. Native FFX calls 1 and 8 read back RGB exactly zero on both input and output. At the last frame 914 pipelines were still being made, so this is not a fully compiled scene verdict.

Concrete feeder-policy observation: the watched graphics key 3e1221d183a0bae690bf40a7dde15927 is DistantObjects / DISTANT_LIGHTS3D (VS 8157a974717876a9, PS 3ded230430ee2590), not the sole HDR producer. At native call 8 it was recorded and queued. Its reached depth resource had 81 recorded dropped writers; Graph::feeding rejects the entire resource because FAN_IN_MAX=4. Three of the first four sampled writers were already ready, but remain in the count. Could the cap apply to still-actionable/pending candidates rather than all historical dropped writers? A useful regression would start over the cap, complete most writers, then require promotion of the few remaining pending writers without broadening admission.

Important limit: the diagnostic walk hit its independent 256-pass/edge cap. This establishes an excluded depth route, not exclusion through every colour route or proof this policy causes the black screen. An earlier run had the watched key ready and still black. No fan-in limit was raised or shader refusal bypassed.

Additional attribution: all six terminally refused compute programs sampled UAV buffers, not HDR textures. Offline effect metadata identifies four as InstanceCulling prop/tree passes and two as VFX relocation passes. Buffer-to-geometry/indirect-consumer causality is not yet established; exact-program owner-fix verification is next.

Local evidence: .compat-runtime/logs/refused-feed-trial-20261127T080855Z/summary.json, 20261127T080927Z-{console.log,resources.csv}, and verify-scene-shader-effects-20261127T081804Z/console.log. Max GPU 4239 MiB, min available RAM 5251.3 MiB, max scope 9049.5 MiB; time stop/137, no resource stop. Diagnostic-relaxed vkd3d 2576c0b4adfae4a+; not stock-Wine certification. No title assets or images attached.

A resource with more than FAN_IN_MAX dropped writers was not followed to
them, so a target a frame dropped 81 draws into stayed out of the walk
even once most of those pipelines had been made: the cap counted drops
the frame could no longer hurry.

The cap now counts the writers whose pipelines have no answer yet (not
made, not refused), and the walk takes only those: made (or refused)
writers leave the resource as it is, and the few still pending leave it
stale and go first. Many pending writers still skip the resource, as the
666-pipeline round requires: pending draws into depth or a geometry
buffer are what the cap is for.

`pipeline::pending` asks `make::being_made`; `Graph::feeding` is given
the predicate (the tests' graphs have no pipelines). Added tests: 81
recorded writers with 78 made give the three pending ones; refused
writers neither fill the cap nor are taken; the many-pending case still
gives none.
@neonbyte1

Copy link
Copy Markdown
Author

@pickles976 You're right, the cap was counting drops rather than writers that could still be hurried: 81 recorded drops stayed 81 after 78 of those pipelines had been made, so the resource was skipped with only three writers left that could still leave it stale.

b6c2b256 changes Graph::feeding to count only writers whose pipelines are still pending (pipeline::pending, i.e. no answer yet — neither made nor refused) against FAN_IN_MAX, and to return only those. Made writers no longer fill the cap, so a target that has most of its writers made is followed and the few still pending go first; refused writers are neither counted nor taken. The cap still applies per resource to the pending set, so a target with more than four pending dropped writers (depth or a G-buffer hundreds of drops are still writing) is still not followed — that keeps the 666-pipeline round from coming back, since those were pending at the time.

Tests are CPU-only under wine on the Windows target (feeds:: shown:: pipeline::make:: draw::tests::, 42 passed): the regression you suggested is writers_made_since_do_not_fill_the_cap (81 drops, 78 made, the three pending promoted), plus refused_writers_neither_fill_the_cap_nor_are_taken and the existing a_target_many_dropped_draws_write_is_not_followed for the many-pending case. Clippy (-D warnings, with and without diagnostics) and the format check are clean.

I can't verify your black scene here — that needs a run of the title with your build — so this is only checked at the walk's bookkeeping level. If you can re-run the scene with the branch and the made first: log, that would confirm it end to end.

AI-assisted (Claude); no game data shared.

@passerbyyhx

Copy link
Copy Markdown

@neonbyte1 Yes, please take the two-frame worker fixture with the original commit author. Thank you for offering. I also applied it unchanged to b6c2b2569eb11f49fcab53839cc112df2c02edc9 and reran it on Windows. Frame one promoted 1–8, frame two promoted 11, 10, 9, and the worker claimed all 16 candidates exactly once.

The worker gate is process-wide, so the fixture is marked ignored and runs as a standalone test:

cargo test --locked -p victory-gpu --lib pipeline::make::two_frame_probe::presents_promote_at_most_eight_available_feeders_nearest_first -- --ignored --exact --test-threads=1

This fixture exercises the per-frame promotion cap. Your separate pending-writer fan-in test covers the change in the latest commit.

AI-assisted with Codex.

@neonbyte1

Copy link
Copy Markdown
Author

@passerbyyhx thank you, taken unchanged as d626b01a with you as author, on top of the fan-in change.

One small follow-up of mine on top, ca937383: cargo clippy -p victory-gpu --all-targets -- -D warnings (CI's form) flagged collapsible_if in two_frame_probe::pause, so the nested if is now one if let ... && .... No behaviour change.

Run here under Wine (CPU only, display-less) on the RTX 5090 machine: pipeline::make::two_frame_probe::presents_promote_at_most_eight_available_feeders_nearest_first -- --ignored --exact --test-threads=1 passes. Clippy is clean with and without diagnostics, and formatting and cargo xtask policy are clean.

AI-assisted (Claude); no game data shared.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants