Repair GPU lifetimes, state transitions and external-pass bindings #4016
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4016
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4016"
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?
@deama on GitHub · 2026-11-30 14:42 UTC · original
deama:codex/gpu-stability-fixes→main· +1465 −142 · 21 files · 16 commits · closed without mergingWhat it changes
Several command sequences could leave stale shader inputs or invalid D3D12 resource states, and a failed fence wait could authorize CPU landing/recycling before GPU completion. This PR bundles the verified correctness repairs from that investigation, with synthetic regressions and explicit software-only validation support.
The most recent reproducer concerns external passes: a callback can bind its own pipeline and static depth SRV, then report failure. Previously
run_externalrestored the title's cached state only on success. The next title dispatch could therefore run with the external pass's bindings after depth had changed, producing SDK message 1003 (DATA_STATIC_WHILE_SET_AT_EXECUTE). The real handoff/binding path reproduces that error on WARP; after this change, it runs the intended title shader and returns the expected value without validation errors.This is a correctness/stability PR. It makes no FPS-gain claim and does not reduce resolution, scene detail, shader calculations or rendering passes. Unproven performance experiments, local launch profiles, checkpoint tooling and machine-specific investigation notes are not included.
1. Recording ownership across command-list cuts
State::next_partfor a new host recording, distinct from restoring bindings on the same recording.2. Fence completion checks and regression coverage
UINT64_MAXmeans removal, and only a real completed value at least equal to the target authorizes landing/recycling.3. Depth and placed-copy state transitions
4. Bounded snapshot allocation
MEMORY_PAGES, excluding its null-sink page. This does not enlarge upstream's shader directory. A local wider-directory build exposed the drift; the regression exercises a synthetic larger ceiling with virtual reservation only, while production retains upstream's actual limit.5. Mutable depth and external-pass recovery
6. Fail-closed diagnostics
gpu-validationfeature for the debug layer, explicit WARP selection and light/fault-only DRED without full per-draw profiling overhead.VICTORY_D3D12_ERROR_ABORT=1requires an available debug layer and stops further submission after an API error.VICTORY_D3D12_ERROR_BREAK=1, paired withVICTORY_FATAL_BREAKPOINT=1, reports the SDK message and original calling stack and terminates at the offending recording call. Agility 614 raises a DXGI diagnostic exception (0x87a) for this mode; bounded kernel reads protect the exception reporter from invalid message pointers.replay --warpselection with no hardware fallback, debug-layer preflight and removed-device handling.How it was tested
Latest conflict resolution:
deb50de4, basee1251c31made_forsize classes, in-use accounting, retention window and asynchronous pool release with checked snapshot arithmetic, rejection at 4 GiB minus 64 KiB, and the 64 MiB mapped-VRAM bound. Spare selection preserves the original pool index and excludes oversized fallback buffers for mapped requests.card_passarguments together with the valid dummy capture UAV bindings required by the test shader. Upstream's low-address reserve, eviction-race guards and startup cache/preload changes remain intact.cargo test --locked -j2 -p victory-gpu --features diagnostics --lib --no-runpassed.cargo check --workspace --all-targets --all-features --locked -j2passed, including the feature-gated replay code.Lowered::loop_capsandShadow::rangeddead-code errors. The all-feature check also warns about the unchangedcopystat::mbhelper. No lints were relaxed.git diff --cached --checkpassed. Whole-tree policy still reports the unchanged upstream 560-character run incrates/victory-shader/src/native.rs.Earlier clean PR branch at
df932780(basec71899d9)0x887a0005, synthetic SDK message and original stack captured, with no GPU commands submitted.cargo build --release --locked -p victory --features gpu-validationsucceeds on this clean branch.Hardware integration evidence and its limits
41adb551, before this clean PR extraction and the later upstream update. The extracted PR branch onc71899d9has fresh software validation, not a separate fresh hardware playthrough. The tests establish the repaired defects; they do not prove which command caused earlier machine-level timeouts or establish permanent driver stability.CI status
The new GitHub CI run for
deb50de4reportsaction_required, so hosted CI has not passed and needs maintainer action. GitHub reports the PR as mergeable after the conflict resolution; it remains open.cargo clippy --workspace --all-targets --locked -j2 -- -D warningswas rerun after merginge1251c31and remains blocked by upstream dead-code errors forLowered::loop_capsin tests andShadow::ranged. These files are unchanged by this PR; the same blockers were previously reproduced on untouchedc71899d9. The current all-target/all-feature check succeeds with warnings, including unusedcopystat::mb. The strict all-feature gate was not separately rerun for this merge. This PR does not disable or relax CI lints.Whole-tree asset policy still reports a pre-existing 560-character hex/base64 run in
crates/victory-shader/src/native.rs, which remains identical toe1251c31. This PR does not change that file or suppress the policy. The staged merge files pass policy; the inherited whole-tree failure still needs upstream attention.The full hardware-sensitive GPU/workspace suite was not run on the user's physical adapter. The selected WARP checks, loader/application suites and intentional-exit probe above are the completed validation, not a claim of fully green CI. Reproduction instructions are in
docs/gpu-stability-validation.md.Checked for overlap
draw.rschanges if either lands first.list.rs; this PR addresses binding restoration and copy-state lifetimes, not those cross-format copy policies.The current base is
e1251c31, merged indeb50de4. The updated upstream code is retained, including its new defaults, send-pool retention policy, low-address reserve, descriptor-eviction protections and startup cache/preload changes. The conflict resolutions preserve checked snapshot bounds, bounded mapped-VRAM spare selection and the compare test's dummy capture UAVs alongside upstream's capture arguments. Earlier integration retained theHostListbarrier-helper API, allocation-search backoff, CPU-mirror export and fence-wait scope, and adapted clear-state tests to the removed draw-local depth cache. The latest verification is listed separately above. The larger performance/development history remains separate and is not part of this PR.Review focus
Please focus on recording ownership across cuts, completion-before-recycling, the combined-read barrier before-states, and restoring bindings after partial/failed external work. The allocation and ambient-signature overlaps above are called out explicitly for coordination.
Signed: GPT 6.0 astra
@deama on GitHub · 2026-11-30 14:43 UTC · original
@trustno1-coder, could you review this stability bundle, or route it to the appropriate repository maintainer?
The main review points are recording ownership across list cuts, copy/depth state transitions, snapshot allocation bounds, and restoring title bindings after an unsuccessful external pass. The description includes the exact software regression evidence, the limits of the earlier hardware validation, and overlaps with #3729 and #3572. It also identifies the current upstream Clippy and whole-tree asset-policy blockers separately from this PR's passing checks.
GitHub does not allow this contributing account to assign formal review requests, so I am requesting maintainer review here.
Signed: GPT 6.0 astra
@trustno1-coder on GitHub · 2026-12-01 18:47 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed