Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,22 @@ Fork: MagiccConch/VIctory, upstream: Marvisak/VIctory. CI: windows-latest only (

- Run 6 (07:26, presumably aa133a1 — NO 0x887A0006 this time, so the intro fixes likely ran and held): crashed at the SAME title instruction as the heap-era null writes (image+0x2215c35, identical rcx=0x4189374bc6a7f0 across all four occurrences — a constant-derived pointer), amid the past-cap flood (count=934464, indices ~1,136,xxx). Two processes 41 s apart (XLaunchNewGame self-relaunch crashed again) → both died early-ish, ~2 min in, near/past the intro. VICTORY_LOG_FILE was NOT set for run 6 (stale PowerShell window) → no full log; stderr excerpt only.
- Clamp wiring verified sound (2026-11-25): shader_cache::build() → host() first (cap probed, set_view_heap_limit) → key includes cap; every HostShader carries view_limit read at translation time; shaders clamp createHandleFromHeap indices to cap-1 (null last slot). So a past-cap slot reads a NULL descriptor on the GPU (safe). The null write is the TITLE CPU on wrong data: either (a) GPU-written heap bytes the title reads back that copy-back missed (suspect: writes through paths that don't mark pages — e.g. the twin bridge CopyTextureRegion, or unmarked UAV writes), or (b) the title needs real views at slots ≥ 934,464 → the two-heap REMAP (sketch: uniform root layout, heap0=title [0,1e6), heap1=title [1e6,1179648)+dynamic tail, SPLIT=1e6 in emit; touches emit/shader.rs, pipeline/make.rs, descriptor/host.rs, GPU_RANGES). Do NOT build the remap before the run-7 log confirms which mechanism.

## Run 7 (07:03, aa133a1): removal mid pipeline-creation flood; upstream scan (2026-11-25)

- Run 7 = the 0x887A0006 crash record (07:03:52): device removed after a submission of 7 lists, mid PSO-compilation flood, ~2 min in. Debug layer was OFF (zero `D3D12:` lines). The log tail shows `no room for the null buffer views` (warn, once) and `no breadcrumbs`; `method not implemented` (2, victory_gpu::object device slot 0x218/0x1c8) near the end is HLE-noise, unrelated. NO past-cap warnings before this removal (run 6 had 187,078) — the title reached further.
- crashes.log now holds 8 records: 4× null-write 0xc0000005 image+0x2215c35 (rcx=0x4189374bc6a7f0 constant in ALL — 02:17, 04:39, 07:26:14, 07:26:55; the 07:26 pair = run 6 self-relaunched 41 s apart), 2× 0x887A0001 (04:53 sampler era, 06:03 B4G4R4A4 era), 2× 0x887A0006 (07:03 run 5's hang-era, 07:03 run 7). The 07:26 crashes mean the intro fixes (aa133a1) held past the picker but the null-write path re-surfaced.
- **Run 7 root cause (fork gap, fixed in PR #13, branch capped-null-buffer-views, commit 2e388ec):** the title heap landed on the PORTABLE_VIEWS cap path (count+MIN_DYNAMIC=1,065,536 > 1M → make(1M), count=934,464, dynamic=131,071) — there `pairs_end` was `total-1` but `pairs.0` started at count+extra=1,065,535 > pairs_end: the pair range was EMPTY (starved; pairs recycled through dynamic slots), and the null raw SRV/UAV for computed buffer-view indices (NULL_BUFFER_VIEW=2,097,150/-1) sat PAST the 1M heap → never made → the "no room for the null buffer views" warn. PR #13 fixes: buffer_guard clamps computed indices below view_limit and reads null SRV/UAV at limit-2/-3 (upstream PRs #2177/#2185's direction, not yet merged upstream); capped heap reserves last 3 slots (null SRV, null UAV, clamp guard); exact-fit rungs trim 3 dynamic slots; deep-cap path reserves CAPPED_PAIRS (1<<15 slots = 16,384 copy-back pairs) with full MIN_DYNAMIC; pipeline-library tag hashes the cap (library-reuse bug fixed); past-cap warn throttled to 1/s (highest-so-far), new maxima at debug. AMD paths byte-identical (min(NULL_BUFFER_VIEW, total-2) == NULL_BUFFER_VIEW on 2M heaps).
- **Upstream scan verdict (git):** merge-base main upstream/main == 940d32f == upstream/main tip — the fork already contains ALL merged upstream work. Upstream main CI green (45527330187, 01:39). Fork main CI green through df2da99. 3 upstream PRs merged 2026-11-25 00:20–01:12 (#1911, #1925 GPU-less-adapter skips; #629 reject multisampled linear layouts) — all in our tree via 940d32f. Upstream NEVER merged PR #1133 (view-heap cap): still open, rebased on 940d32f (head 0d19c4c), split per triage (barrier → #2035), triage verdict "merge-candidate" (2026-11-25 07:23), tested RTX 5060/5070 + RX 7700 XT. Our port = PR #11 (c4b3947); diff vs 0d19c4c is only the struct-literal shape (Options) — semantically identical, no catch-up needed.
- Upstream open-PR traffic on OUR exact problems: #2177 (clamp+null buffer views in capped heaps, RTX 5060 Ti tested), #2185 (clamp to cap, "world uses title slots past 1,236,191" — same run shape as ours), #2189 (graceful degradation tiers 1M→500K→250K→MIN_DYNAMIC + cursor wraparound), #2180 (strip unsupported UAV/RT format flags — same idea as fork's 5ecd621), #2187 (deny-SRV share), #2186 (WARP u32→f32 rounding), #2190 (typeless view mapping). Watch #2177/#2185/#2189 for upstream merge — they touch descriptor/host.rs and emit/lower.rs, both files PR #13 touches; rebase PR #13 or re-port after upstream merges whichever wins.
- Upstream CI note: PRs from first-time/external forks come up `action_required` (approval-gated); do not read that as a failure. Merge-candidate verdicts appear in issue comments as `victory-triage v1 ... verdict=merge-candidate`.
- Toolchain note (container): no cargo preinstalled — `curl https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.98.1 --profile minimal`, `rustup target add x86_64-pc-windows-gnu`, `sudo apt-get update && sudo apt-get install -y mingw-w64` (test binaries need x86_64-w64-mingw32-dlltool; check/clippy do not). All three gates green locally.
- Run 8 plan: user re-pulls PR #13, rebuilds, deletes nothing (cap unchanged → shader cache keys stay; library tag changes → pre-build remakes the library), re-runs pre-build (tag changed → it will list 0 found and remake), then runs with `VICTORY_D3D12_DEBUG=1` + `VICTORY_LOG_FILE=victory-run8.log`. Expect: no "no room for the null" warn, `kept=705085` in the capped warn, ≤60 past-cap warns/minute, and the null-write question decided — if image+0x2215c35 recurs, trace the copy-back/twin-bridge write-marking path in victory-run8.log.

## Upstream issue scan → run-8 fixes (2026-11-25, commits 3bf9424 on PR #13)

- Ranked the open issues by impact on our capped-heap/NVIDIA era (user instruction: deference to NVIDIA/AMD GPU issues). Top-10 shortlist read in full: #747 (capped 2^16 dynamics starve world tables — MEASURED on RTX 4070 Ti: G-buffer 0.1% → 2^18 → 60-65%), #911 (rejected binds retain dynamic reservations), #1118 (the +0x2215c35 null-write family — title-allocator exhaustion on a worker thread, RTX 3070 Ti, same stack as ours), #698 (NVIDIA no-removal breakpoint 6.7 min), #850/#876 (cutscene picture missing; typeless view mapping PR #2190 "ready to merge" but UNMERGED — 494-line descriptor rework, deferred), #653/#71/#778 (DRED wave64 mesh TDRs), #1001/#886/#468 (Ampere wave64/untranslated/E_INVALIDARG families), #400 (frame-time forensics), #1633 (coordination hub).
- **#747 ported (commit 3bf9424):** the fork's `MIN_DYNAMIC` (2^16) was exactly the starved config upstream measured — run 7's heap (count 934,464) took the `count + MIN_DYNAMIC == cap` rung. Fix: the capped path now takes the fork's `DYNAMIC` (2^18) over title slots past it; `MIN_DYNAMIC` and its two duplicate rungs deleted; deep-cap title = PORTABLE_VIEWS - DYNAMIC - CAPPED_PAIRS - 3 = 705,085 (was 836,157 with 2^17... actually was 836,157 under PR #13's first cut with MIN-sized deep-cap; the 2^18 port makes title coverage 705,085 with 262,144 dynamics + 32,768 pairs + 3 null = exactly 1,000,000). Layout: title [0, 705,085), dynamic [705,085, 967,229), pairs [967,229, 999,997), null UAV/SRV [999,997, 999,999), guard 999,999. The exact-fit rung (cap == count + DYNAMIC) keeps ALL title slots with the -3 trim.
- **#911 ported (same commit):** `tables()` now rolls back the failing stage's just-allocated ranges on `table_failed` — release(first, n), fresh_tables entry removed, self.dynamic entry dropped, made cleared. Safe because those binds were never recorded (the draw drops before its root arguments are set); later draws re-make them. Previous behavior cached them until list reset, amplifying exhaustion exactly as #911 describes.
- NOT ported now: #876/#2190 (typeless views — 494-line unmerged rework; our cutscene/UI symptoms were addressed by the twin work), wave64/compute translation (#2176, large), #2189's tier ladder (our ladder already degrades gracefully with the 2^18 port). Re-check #2177/#2185/#2189/#2190 when upstream merges any — all touch descriptor/host.rs + emit/lower.rs, which PR #13 now modifies; expect rebase work then.
- Run 8 expectations UPDATED by 3bf9424: capped warn now logs `kept=705085`; `host view heap capped at 1000000` count=934464. The past-cap title range widens (title slots [705,085, 1,179,648) read null) — that is #747's accepted trade (its own tested config mirrored only 672,319 title slots). Watch for "no dynamic slots" drops GONE from the log (was thousands/frame in #747's measurements).
Loading