Skip to content

Offline RX 5700 XT launcher, diagnostics, and guarded texture profiles - #3745

Draft
blkph0x wants to merge 11 commits into
Marvisak:mainfrom
blkph0x:feat/offline-launch-debug-rx5700
Draft

blkph0x wants to merge 11 commits into
Marvisak:mainfrom
blkph0x:feat/offline-launch-debug-rx5700

Conversation

@blkph0x

@blkph0x blkph0x commented Nov 28, 2026 •

Copy link
Copy Markdown

Scope

This is the complete source-only RX 5700 XT/offline-launch work from this branch. It adds a guarded Windows launch and diagnosis flow, an opt-in cooked-texture path, and renderer fixes found while tracing the first world frames. It does not establish a playable or 30 fps RX 5700 XT build.

Launch, isolation, and local diagnostics

  • Add a four-tab Windows launcher (Game, Graphics, Performance, Debugging) with saved settings, detected GPU, 720p/1080p/native/custom profiles, title quality/effect controls, a master shadow switch, explicit experimental ray-tracing control, 85%-of-current-DXGI-budget VRAM slider, root-buffer system RAM slider, and one-time shader/pipeline prebuild.
  • Add local shader, texture, sprite/target, frame, DRED, coverage, and GPU-timing controls. Full-resolution presented-frame capture is opt-in; target readbacks retain their reduced preview size.
  • Build offline, verify exact title/loader inbound and outbound WFP blocks including loopback before launch, and keep launch plans/logs in checked fixed-local paths. Reject UNC, mapped-network-drive, and reparse paths for launcher state, game inputs, selected cook inputs, and output roots. Pin the loader's cache, data, and config to checked local locations so inherited variables or a game-folder victory.toml cannot redirect writes.
  • Add a bounded RX 5700 XT world-run harness with automatic Enter, frame/target captures, shader and descriptor coverage, budget accounting, optional DRED/exit tracing, and strict diagnostic gates. The native first-run path builds offline, logs locally, checks WFP, and limits its job to one title process.
  • Add source-only native runtime/shim build and first-run scripts. No game executable, DLL, RPF, decoded texture, screenshot, cache, or log is part of this PR.

Graphics and texture handling

  • Add title settings edits for resolution and quality, 720p presentation/window limits, Series S/FidelityFX controls, compute-to-vertex mesh fallback, a guarded RGB9E5/shared-exponent path, shadow and ambient fallback controls, and additional shader lowering/validation and capture probes. These are compatibility/diagnostic paths, not a general shader-quality compiler setting or true render-target downsample.
  • Improve host texture admission and retry after temporary memory pressure, descriptor/used-null accounting, view/materialization diagnostics, copy/readback handling, and placed-resource/buffer management. Adapt the GPU-written texture alias synchronization from GPU: sync aliased texture sources before copy commands #3170 for CopyResource, CopyTextureRegion, and readback.
  • Keep the exact observed 1024² BC3/11-mip raw-block copy destination's top mip before its first host creation, with a 4 MiB concurrent extra-allocation cap and existing-heap-only behavior after the stream budget closes. This fixes the traced skipped mip-0 copy without broadly admitting all large textures.
  • Adapt GPU: every removal report carries the DRED data #3736 so every detected device removal carries DRED data, GPU capture: save half-float presentation frames #3689's half-float capture preview behavior, GPU capture: allow full-resolution presented-frame PNGs #3652's full-resolution presented capture option, and CLI: fail shader warm-up on missing input roots #3542's fail-fast check for missing shader warm-up input roots.

One-time cooked profiles

  • Add semantic offline texture cooking for separately supplied, classified 2D source images (color, normal, material, cutout, UI/detail) and 720p/1080p outputs. The menu's Cook verified textures... action runs cooking, builds/validates a profile, and writes local logs.
  • Runtime substitution is opt-in and limited to explicitly verified same-format BC mip identities, with original detiled-mip and cooked DDS BLAKE3 checks, fixed-local input checks, a bounded cache, and original-upload fallback. Original title archives are retained. This is not automatic replacement of every texture, render target, sprite, atlas, BC6/HDR image, or material.

Upstream PR review and decisions

I inventoried the titles and bodies of all 1,816 open PRs in the final review snapshot and inspected the renderer, capture, shader, streaming, and CLI candidates relevant to this branch. New #3737–#3743 candidates were reviewed separately as the inventory changed.

PR Decision Evidence
#3170 GPU-written alias copies Adapted Its new copy regression was red on this branch's baseline (all-zero readback), then green with the synchronization fix; focused GPU tests pass in diagnostics and no-default modes.
#3689 half-float capture PNG Adapted Focused test passed on the PR head and after integration; malformed rows are rejected.
#3652 full-resolution presented PNG Adapted Focused test passed on the PR head and after integration; the option does not expand target readbacks.
#3542 missing warm-up roots Adapted Focused test passed on the PR head and this branch; missing input fails before creating an apparently successful cache.
#3736 complete DRED removal reports Adapted A pure removal-data regression was red on this branch before the change, then green (2/2); submission reports include DRED once, and non-submission failures now retain it too. No hardware removal occurred in the latest game run.
#3537 RGB9E5 view compatibility No cherry-pick Its focused test passes upstream, but this branch already has a broader R32_UINT/shared-exponent alias bridge and the patch conflicts with that path.
#3647 partial-mip clamp Deferred Its format tests pass, but it cannot restore the missed BC3 mip-0 copy and changes explicit LOD/view semantics without a game validation.
#2297 first-use upload Deferred Its test does not cover this branch's submission ordering, which hoists texture uploads ahead of the lists that use them.
#1272, #3706, #3543, #3529, #3414, #3588, #3670, #3584, #3715, #3687 Deferred These are distinct paths, overlap existing local fixes, or lack evidence for the observed used-null/budget failure; see the issue-specific tests and diagnostic coverage below.
#3737–#3740, #3742–#3743 Deferred Newly opened narrow DXIL or diagnostic-ranking optimizations. Their PRs do not report game-frame measurements and do not address the current admission failures.

Please retain credit for the adapted upstream contributions: #3170 by fuzeofficlal, #3542/#3652/#3689 by andrewpozdnakov7-jpg, and #3736 by Ingenioeren.

Verification

  • cargo test --offline --workspace --locked: pass (including GPU, shader, runtime, and asset-policy tests; the repository's declared ignored benchmarks/reference-data tests remain ignored).
  • Both CI Clippy modes pass with warnings denied: cargo clippy --offline --workspace --all-targets --locked -- -D warnings and the same command with --all-features.
  • Diagnostics and no-default focused alias/BC3/capture tests and checks: pass. cargo check --offline --manifest-path apps/victory-native-runtime/Cargo.toml: pass.
  • Offline release native runtime and all shim DLLs: built successfully to an ignored test output directory. First-run helper rejects a requested two-process job.
  • Python cooker/profile/diagnostic test scripts: pass. The one-time menu cook completed on a real classified 4K source pair, produced a separate output profile, and validated one 720p original-mip identity. This is a cooking/verification proof, not evidence that the current game scene sampled that texture.
  • Launcher menu/negative-path suite, preflight UNC/mapped-drive/junction rejection, PowerShell syntax, git diff --check, and cargo xtask policy: pass. The GUI form was constructed and validated programmatically; a full visual click-through of its Windows form was not available through the computer-use surface.
  • Controlled RX 5700 XT / Ryzen 3900X 720p world run: exact loader WFP inbound/outbound/loopback preflight passed, TCP/UDP monitor maxima were 0/0, the world frame completed, 1,773/1,773 bound shader paths translated, zero unexpected drops, and no GPU removal. The BC3 destination retained mip 0 (first_host_dropped=0). Strict graphics gate failed: median 1.3 fps, 3,069 shader-used valid texture-null events (all host-copy-unavailable), and 721 used buffer Budget nulls. Texture retry ran 5,018 times and recovered 697 views, but the combined 9 GB stream admission cap remained under pressure. Socket sampling is diagnostic; WFP verification is the isolation gate. These filters apply to the title/loader executable, not arbitrary preparation/debugger processes. The raw C first-run helper requires its protected PowerShell wrapper; direct invocation is not an isolation gate.

Follow-up diagnosis on this branch

  • Added a bounded shader-use-weighted identity census for null texture views (source, title address, dimensions, format, failure reason, example pipeline/root slot); the 120-second offline world run had no census overflow and identified a repeatedly used 1x1 format-41 missing texture. This is shader-use evidence rather than a count of every descriptor materialization.
  • Added placement-failure counters and fixed strict-run shutdown to wait for drop, buffer, and texture reports through the latest FPS row. The previous strict run stopped between its final FPS line and reports, leaving one interval unclassified. PowerShell parsing and the timestamp replay confirmed that race.
  • Controlled 720p RX 5700 XT run with full coverage: 1,771/1,771 bound shaders translated, 1.7 fps median, 1,395 used null texture events in 14 classified intervals, 7,554 used Budget-null buffer events, zero observed sockets and no GPU removal. The strict graphics gate failed. One final interval is unclassified because this run predates the harness fix.
  • The first instrumented repeat reached a world frame, then the title's known watchdog deliberately wrote to null at image RVA 0x23cf683 and exited 0xc0000005 before the cap closed. The title's Breakpad upload was blocked by the HLE network layer; WFP and the socket monitor observed no endpoints. This run cannot diagnose placement pressure.
  • A repeat with full view/pipeline coverage disabled completed 90 world seconds: 1,724/1,724 bound shaders translated, all 10 drop/used-null intervals classified, 1.55 fps median, 61 valid used null texture events, 477 used Budget-null buffer events, zero observed sockets, no GPU removal or watchdog. Of 1,078 reuse-only sampled-texture attempts, 897 succeeded and 181 deferred. All 189 failed placement sub-attempts lacked an eligible existing heap range; none were unplaceable or rejected by D3D12. Different frames and coverage overhead prevent a causal claim about the watchdog or the miss-count difference.
  • cargo test --offline --workspace --locked, both strict workspace Clippy modes, the diagnostic analyzer tests, PowerShell syntax, git diff --check, and cargo xtask policy pass on cd52b2b. The PR stays draft because the live graphics gate fails.
  • A paired offline two-minute uiOverlay=true/false test held the 720p launch and loader binary fixed. Both arms set the secondary title dimensions to 3840x2160, enabled the secondary flag, listed a 4K PresentX plane, and created 17 4K textures; neither reached the world. The original settings were restored byte for byte, and each arm saw 0/0 TCP/UDP endpoints under verified WFP blocks. This rules out uiOverlay alone as the switch for the extra 4K path. See docs/shader-audit.md for the observed addresses and limits.
  • A focused offline CDB hardware watchpoint caught the secondary 4K flag becoming one during a 0x1e8-byte memmove of display state into the prepared image globals. The copied state already held 3840x2160. The title copy site is image RVA 0x19f4e15, called via 0x5804379; the original object-state producer remains unidentified. The harness now accepts a local custom CDB command file with -TraceExit while retaining the exact-loader WFP preflight. PowerShell syntax, its negative option gate, and git diff --check pass. See docs/shader-audit.md for the stack, limitations, and raw-run identity.
  • A second offline hardware watchpoint followed the secondary width from its object constructor: it starts at zero and becomes 3840 when a later 0x1e8-byte stack temporary is copied into the source object at title return RVA 0x43a48de. The adjacent source fields then hold 2160 and flag one. The earlier zero-valued initialization pass and later 4K copy show multiple settings passes; the operation selecting 4K is still not identified.
  • Reviewed GPU: write faults read the bytes they save without the guard lock (revives #3035) #3754 after its author explicitly flagged interaction with this PR. Its unlocked guarded-page read relies on an OPENED counter for every page opening. This branch's run-batched open_guarded removes pages without such a counter; importing GPU: write faults read the bytes they save without the guard lock (revives #3035) #3754 unchanged would permit stale saved bytes. It also has a reported rare unresolved test failure and no RX 5700 XT world measurement. I have not imported it. Any combined implementation must bump each page's counter before the batched VirtualProtect and pass concurrent saved-byte tests and a controlled game run.
  • Refreshed the open-PR inventory before this update. New Shaders: simplify f32 min and max with literal operands #3744 (literal min/max shader emission) and Formats: specialize the first two XMA FFT stages #3746 (XMA FFT stages) have focused upstream tests, but no measured benefit for the observed heap-range shortage; neither was imported. Upstream main has not advanced past 63bcca4.

Launcher persistence and local file discovery

  • The Game tab searches the launcher folder, or a selected local folder, recursively for the title EXE and a complete pair of PC FidelityFX DX12 DLLs. It skips reparse points, rejects network paths, reports ambiguous matches, and offers pickers when files are missing.
  • Save settings and Close now persist every menu choice, including incomplete paths, to local JSON. Writes replace the old settings atomically. Launch offline still validates the complete plan before running.
  • Verified the menu under Windows PowerShell 5.1 and passed the headless launcher suite, including reopen/roundtrip, incomplete draft, nested discovery, incomplete DLL pair, ambiguity, and unsafe-path rejection. cargo xtask policy passed (245 files).

Open work / review focus

The latest change makes bounded texture eviction keep scanning after an
oversized candidate, so smaller old textures can release reusable heap
ranges within the same per-frame allowance. Targeted idle and budget-driven
regression tests pass; the RX 5700 XT world effect remains unmeasured.
The 4K source trace now reaches the title display callback's alternate
width/height fields; their earlier setter is still under investigation.
The diagnostic build now logs up to 24 distinct closed-cap placement misses
with each texture's shape, allocation size, and alignment. This can be
compared against the existing reusable-range census in the next guarded run.
All 344 active diagnostics GPU library tests pass when run serially.

  1. Reclaim or prioritize sampled-texture heap ranges under the 9 GB cap using the new shader-use-weighted identities and placement-failure counters. The measured closed-cap misses are lack of eligible existing ranges, while earlier cap increases removed the GPU.
  2. Resolve the remaining valid texture and Budget buffer nulls, dark/overbright regions, and frame-time cost. The current branch is not verified playable or at 30 fps on the RX 5700 XT.
  3. Expand cooked profile coverage only with verified identities and scene-use evidence. Preserve title archives and reject mismatched assets.

The PR is a draft because the strict world graphics gate still fails and the change set spans launcher, native runtime, shader translation, texture handling, and GPU diagnostics. Review can be divided by the sections above.

blkph0x and others added 3 commits November 29, 2026 01:14
Add the four-tab local launcher, native offline first-run tooling, semantic
texture cooking and verified profile fallback, and bounded renderer probes.
Integrate tested upstream alias-copy, DRED, capture, and warm-up fixes.
Keep the remaining used-null and frame-rate failures visible in diagnostics.

Co-authored-by: fuzeofficial <bochunran@gmail.com>
Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>
Co-authored-by: Ingenioeren <citybozz@gmail.com>
@reallyvibe

Copy link
Copy Markdown

Thanks for checking #3754 against this branch. Your diagnosis is right: here the batched open_guarded takes pages out of protected without moving OPENED, so a fault's unlocked read can keep stale bytes.

Bumping each page's count before the batched VirtualProtect fixes it if:

  • the bump is unconditional: every page in pages leaves protected, whether or not its VirtualProtect (batched or the per-page retry) succeeds;
  • it covers the alias pages merged into the open list, one bump per page: counts are shared by page % 4096, so one bump per run is not enough.

Note that the two PRs merge with no textual conflict, and the merged code drops the bumps silently. #3754 now has a deterministic test for this, opening_guarded_pages_moves_each_ones_opened_count (5c4bdd6d).

What I ran is a watch.rs-only simulation, not a full integration test: #3754's tree with the merged watch.rs, none of this branch's other files. Merged as is, the new test fails 20 of 20 runs in debug and release. With this at the top of open_guarded, all watch::tests pass:

for &page in pages {
    opened(page).fetch_add(1, Ordering::Relaxed);
}

I have not built or tested your full branch with #3754.

AI-assisted (Claude Code).

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.

2 participants