Skip to content

Allow sub-MiB VRAM buffer thresholds and rank CPU snapshots - #200

Closed
Kamiloj9 wants to merge 1 commit into
fxceless:mainfrom
Kamiloj9:codex/sub-mib-card-buffers
Closed

Kamiloj9 wants to merge 1 commit into
fxceless:mainfrom
Kamiloj9:codex/sub-mib-card-buffers

Conversation

@Kamiloj9

Copy link
Copy Markdown

Changes

  • Add the opt-in VICTORY_CARD_BUFFERS_MIN_KB threshold for VRAM-backed shadow buffers. A valid KiB override takes precedence over the existing MiB setting. The default threshold and VRAM budget are unchanged.
  • Add an opt-in CPU snapshot ranking in diagnostics builds with VICTORY_SNAPSHOT_RANK=1. It attributes declared snapshot ranges to live buffers and records their VRAM admission outcomes.

Verification

  • 22 shadow tests passed with diagnostics and 21 passed without diagnostics on the PR base. Asset policy passed. Clippy passed on the integrated checkout.
  • On an RTX 4080 SUPER with the range-lock changes from Scope title memory mapping locks to affected ranges #175, the same checkpoint and a 1 MiB admission threshold, raising the card-buffer budget from 512 to 1024 MiB brought the three sampled 3D present medians from 582/733/558 ms to 395/401/303 ms.
  • At 1024 MiB, a separate 640 KiB trial reduced late CPU snapshot volume from roughly 28 to 17 MB per frame. Both runs reached 3D without a logged device loss. Present medians improved in two of three windows, the worst sampled hitch increased, and 3D appeared later. The 640 KiB configuration remains experimental.

dkdknight added a commit to dkdknight/victory-fork that referenced this pull request Nov 25, 2026
…, small buffers on the card, parallel page merge, absent blocks asked outside the guards' lock, PR fxceless#853 alias guard, GPU_UPLOAD windows, legacy multiply and wide scalar loads); view guard back on in play-lod.ps1

Written by AI agents from this session's leads, reviewed and built here;
measured separately. Switches:
- VICTORY_INDIRECT_CARD_BUDGET (on; =0 as before): the clamp's per-list
  budget counter in card memory, zeroed by the clamp shader's own entry,
  instead of a system-memory buffer with 1-4 atomics per clamp over PCIe
  (after fxceless/victory-fork PR fxceless#220).
- VICTORY_CARD_BUFFERS_MIN_KB (off): card copies for title buffers under
  1 MiB, floor 64 KiB (after PR fxceless#200).
- VICTORY_MERGE_THREADS (4; =1 as before): merge_under_writes reads
  contiguous stale pages in one call and compares them on scoped threads;
  changed_runs skips equal bytes 64 at a time; merging stays in order on
  the submitting thread.
- VICTORY_GUARD_ABSENT_BITS (on; =0 as before): absent blocks still
  uncommitted are dropped from a range's runs before the guards' lock is
  taken (nothing marked clean, unlike parking).
- PR fxceless#853 (Peppacodes et al.) ported: a write through one view no longer
  opens the other views of the page; they are noted written and guarded
  again together (plus clean_bit cleared for the alias).
- VICTORY_UPLOAD_WINDOWS_MB / VICTORY_UPLOAD_WINDOWS_ROOM_MB (off): windows
  in GPU_UPLOAD (ReBAR) heaps, written by the CPU straight into card memory.
- VICTORY_LEGACY_MUL=1|2, VICTORY_SMEM_WIDE=1 (off): plain multiplies for
  exact legacy-multiply cases, scalar buffer loads 4 dwords at a time.
- play-lod.ps1: VICTORY_VIEW_GUARD=0 removed (walls of the cell were
  missing without it: same shot, screenshots).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Kamiloj9 Kamiloj9 closed this Nov 26, 2026
@Kamiloj9
Kamiloj9 deleted the codex/sub-mib-card-buffers branch November 26, 2026 00:29
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.

1 participant