Skip to content

GPU: lists of a frame share fresh tables; count dynamic slot use - #3

Open
mercuryVM wants to merge 1 commit into
mainfrom
impl2/fork-dynamic-slot-stats
Open

mercuryVM wants to merge 1 commit into
mainfrom
impl2/fork-dynamic-slot-stats

Conversation

@mercuryVM

Copy link
Copy Markdown
Owner

What

On fork main f0df6a5. Host heap split unchanged: 934,464 mirrored title slots + 65,536 dynamic. A/B partner: the -1548 PR.

The problem, from world runs 14 and 15 on the RTX 5070:

  • NVIDIA caps a view heap at 1,000,000 descriptors. The title's has 1,245,184.
  • The host mirrors 934,464 title slots and keeps 2^16 dynamic ones.
  • Every table past the mirrored range is copied into dynamic slots for each list that binds it.
  • The slots ran out within seconds of the world. Then draws were dropped ("no dynamic slots for its tables"): 262,144 in run 15, more than 1,048,576 in run 14, about 1,300 a frame late in run 15.

The change:

  • Shared copies. A fresh table is now made once per frame for all lists.
    • Key: title heap, table address, the record words of its entries, slot count, frame. The record words name the views' entries and generations.
    • Every list that binds it holds a share; the last one gives the slots back.
    • Each list still brings the table's buffers up to date.
    • A copy is not shared past its frame, so host copies made since are not missed.
  • Frame-line counters:
    • dynamic slots taken for fresh tables per frame, and how many tables were shared;
    • the most dynamic slots taken at once, and the heap's total;
    • draws dropped per frame for want of them.
  • Drop log. In frames that VICTORY_CAPTURE_FRAMES or VICTORY_CAPTURE_WORLD lists, each dropped draw, dispatch or indirect execution is logged at debug level ("dropped in a listed frame") with why and its shaders. This shows which passes lose their draws.

Tests

Windows 11, RTX 5070, AMD CPU.

  • draw::shared_table_tests::fresh_tables_are_shared_until_the_last_list_gives_them_back (new) passes.
  • cargo clippy --workspace --all-targets -- -D warnings: clean. -p victory-gpu -p victory-shader --all-features: clean.
  • cargo test --workspace --no-fail-fast -- --test-threads=1: 712 passed, 7 failed. The same 7 fail on fork main itself on this RTX 5070, and none is new: 2 victory-gpu heap tests that assume heaps of HEAP_VIEWS (NVIDIA caps at 10^6), 2 PSV0 container checks, 2 stride tests and 1 gather test.

Not tested

The world itself: the next run's frame-line counters will show the slots per frame, the share rate and whether drops for want of slots go away. Run it as an A/B pair with the other variant.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

A table past a capped host view heap (NVIDIA takes 1,000,000 views; the
title's heap has 1,245,184) is copied into dynamic slots for each draw that
binds it, once per list. In world runs on an RTX 5070 the 2^16 dynamic slots
ran out within seconds of the world and from then on about 1,300 draws a
frame were dropped ("no dynamic slots for its tables").

A fresh table is now made once per frame for all lists: keyed by title heap,
table, the record words of its entries (the views' entries and generations),
slot count and frame, held by every list that binds it and given back with
the last. Each list still brings the table's buffers up to date.

The frame line adds the dynamic slots taken for fresh tables per frame (and
how many tables were shared), the most dynamic slots taken at once and the
heap's total, and draws dropped per frame for want of them. In the frames
VICTORY_CAPTURE_FRAMES or VICTORY_CAPTURE_WORLD lists, each dropped draw,
dispatch or indirect execution is logged at debug with why and its shaders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit b5a31f7)
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