Skip to content

Budget: split upload= by creator (Part of #3676 item c) - #3715

Open
SimSalabimse wants to merge 4 commits into
R0Y00:mainfrom
SimSalabimse:local/upload-budget-by-creator
Open

SimSalabimse wants to merge 4 commits into
R0Y00:mainfrom
SimSalabimse:local/upload-budget-by-creator

Conversation

@SimSalabimse

Copy link
Copy Markdown
Contributor

Part of #3676 item (c). Claim: #3676 (comment)

The x2w-budget line keeps upload= as the total and adds seven creator columns between upload= and readback=: upload_ring, upload_slot27, upload_slot70, upload_slot148, upload_linear, upload_mesh86 and upload_other, each in the live/retained form. They add up to upload=.

Linux: upload_budget_check passes on g++ and clang++ with -Werror=narrowing, and startup_triage_run_check.py passes. resource_budget.h needs d3d12.h, so the live/retained charge sites have not been compiled yet. The Windows test PC build and WARP run of startup_resource_budget_creators_warp are still to come. This PR is a draft until then.

#3491 changes report_budget's signature and the local/nonlocal sources. This change leaves both alone, but it shares the category buffer (640 to 2048 bytes) and the print loop, so a small rebase may be needed if #3491 merges first.

AI-assisted (Cursor)

The x2w-budget upload column stays the total. Columns beside it
attribute that total to the ring, device slots 27 and 127, the slot 70
fallback, slot 148 pages, linear staging, the Mesh86 slot map, and
every other upload heap.

AI-assisted (Cursor)

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
@SimSalabimse

Copy link
Copy Markdown
Contributor Author

Windows test at b45c0ad: first Windows build of the resource_budget.h changes succeeded.

WARP: 8/8 passed (startup_resource_budget_creators_warp, startup_resource_budget_warp_debug0/1 with their inline controls, upload_budget, startup_triage_run, and the triage CLI check).

Hardware twins: 5/5 passed.

AI-Assisted

@SimSalabimse
SimSalabimse marked this pull request as ready for review December 1, 2026 09:49
@SimSalabimse

Copy link
Copy Markdown
Contributor Author

Measured the creator split on the Windows test PC with this branch combined with #3716 on main a061032, gfx2hlsl translate mode, about 7 minutes from startup into the first playable 3D area (prologue).

Live upload heap by creator, x2w-budget line:

point upload total upload_ring upload_slot27 upload_slot70
early startup 34,144,256 B / 11 objects 33,554,432 B 0 589,824 B
menu 106,954,752 B / 571 50,331,648 B 524,288 B 56,098,816 B
in the 3D area (last line) 1,080,033,280 B / 14,164 117,440,512 B 524,288 B 961,740,800 B

So in-world, the slot-70 creator holds about 89% of live upload memory, and the ring stays small. Local GPU memory at the last line was 9,746,374,656 of a 11,187,499,008 budget. No device removal in the run.

AI-Assisted

@Leyukaka Leyukaka left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows PR job ran startup_triage_run, but its 257 tests do not include upload_budget or startup_resource_budget_creators_warp. Could both targets and tests be added to the pr presets so subsequent changes exercise the creator accounting on WARP?

check_creators takes its final snapshot while created27 is still live. Releasing that wrapper and taking one more snapshot would exercise the other half of the log contract: one object and its allocation size should move from live to retained in both upload and upload_slot27, with the other creator counts unchanged.

Build and run the portable upload budget check and the WARP creator
fixture in the pull request preset. Verify that releasing slot 27 moves
its aggregate and creator charge from live to retained.

AI-assisted (Cursor)

Co-authored-by: SimSalabimse <SimSalabimse@users.noreply.github.com>
@SimSalabimse

Copy link
Copy Markdown
Contributor Author

Added both targets and tests to the PR presets; the test selection now adds exactly upload_budget and startup_resource_budget_creators_warp. The creator fixture also releases the slot 27 wrapper and checks the exact live-to-retained move while all other creator columns stay unchanged. Tested on the Windows test PC: upload_budget, startup_resource_budget_creators_warp, startup_resource_budget_warp_debug0, startup_resource_budget_warp_debug1.

AI-Assisted

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged current main into the PR branch and resolved CMakePresets.json, preserving its new targets and test selections alongside upload_budget_check, startup_resource_budget, upload_budget, and startup_resource_budget_creators_warp. Both new tests are listed by the pr preset. The Windows Debug run of ctest --preset dev --no-tests=error -j 1 -R '^(upload_budget|startup_resource_budget_creators_warp)$' --output-on-failure passed 2/2. The GPU case used WARP (10.0.26100.9818) on Windows 11 26300.9974 with the preset's debug layer off. New hosted checks are running on the integrated head.

@R0Y00
R0Y00 requested a review from Leyukaka December 2, 2026 05:45

@R0Y00 R0Y00 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Linux failure was the export census (d3d12_xs entries 80 != 79). I pushed a test-only follow-up that counts and checks the source evidence of the existing test hook x2w_budget_mesh86_upload_for_test. python -B tests/standin_exports_check.py now passes 472 cases with 6/6 mutations killed, and python -B tests/startup_triage_run_check.py passes. No budget runtime code was changed in this follow-up. Please review 2638480a once CI has run.

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.

4 participants