startup: count new view records by slot behind an opt-in census #2605
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2613"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by JVProg on 2026-11-25T23:20:43Z.
Change
X2W_D3D12_VIEW_CENSUS=1(diagnostic only, off by default) shows which device slot adds view records.x2w-view-census distinct by slot:heartbeat line, with the record vector size and capacity and theview_idssize and bucket count.missedcounts changes that no line announced.Record identity (including range, format, stride and flags), ids and descriptor binding do not change. The census counts distinct byte contents, not distinct views. It does not measure container bytes or reduce them.
Not in this PR: record dump, call-stack collection, a record lifetime policy and the worker's allocation-failure recovery.
Refs #1199.
Verification
Base
444bf3a8, Windows 11 build 26300, D3D12 debug layer off (X2W_D3D12_DEBUG=0). The checks ran on the same changes before they were committed.ctest --preset dev --no-tests=error -R "^startup_view_census" -V: 6 of 6 passed, on WARP and on an AMD Radeon RX 9070 XT (driver 32.0.32029.2010). No skips.on: both streams run under a job commit limit 256 MiB above the commit held after setup. The fixture first checks that the limit refuses a larger allocation. The repeated stream added no record and grew nothing. The distinct stream was counted as 200,000 (slot 17), 3,000 (slot 18) and 100 (slot 22) new records; growth lines in the log match the counters (records 31, ids 11) andmissed=0.off: nothing is reported or logged without the switch.vary(negative control): the stream meant to repeat changes every call, and the fixture reportsFAIL: the repeated stream added records.ctest --preset dev --no-tests=error -R "^(startup_d3d12|startup_resource_retire|docs_links|bidi)": 28 selected, no failures. Capability skips: the sixstartup_resource_retire*_debug1cases (227, 230, 245, 248, 251, 255 in this build).ctest --preset pr --no-tests=error, after a fullcmake --build --preset dev: 38 selected, no failures. Capability skips: the 14spirv_*_warpcases (SPIR-V tools not set up locally).python -B tests/docs_links_check.pyandpython -B tests/bidi_controls_check.py: passed.Limits: slots 19 to 21 are counted but not exercised by the fixture.
Checklist
docs/startup-runtime.md)AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T23:26:26Z.
Review: COMMENTED
Review of head
c3c8532a(comment only).Result: no blocking findings in the code.
Checked:
X2W_D3D12_VIEW_CENSUSis set. With it unset,note_viewonly reads the cached flag, so record identity, ids and descriptor binding do not change.note_lockheld. The heartbeat reader takes the lock shared. Slot indexslot - 17is range-checked.push_back, so it survives a failed allocation.missedcatches growth that no line announced.x2w_local::env_onas the other opt-in flags. Docs section added indocs/startup-runtime.md. No other open or merged PR adds this census (searched "view census").Commands run (Linux, exact head in a worktree):
git diff --check origin/main...HEAD: cleanpython3 tests/docs_links_check.py: 507 links okpython3 tests/bidi_controls_check.py: okstartup_view_censusis a Windows C++ fixture. It cannot run on Linux, so the Windows run is done separately and its receipt will follow.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T23:28:59Z.
Win2025 WARP receipt for head
c3c8532a.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
c3c8532a6884d1187fb8156004865b966499c380:--preset dev):cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_view_census -- -j 2):1.42s(configure0.00s)ctest --preset dev -R '^startup_view_census' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (1.30s:startup_view_census_off_warp0.15s,startup_view_census_off_hardware0.08s,startup_view_census_vary_warp0.85s,startup_view_census_vary_hardware0.69s,startup_view_census_warp1.07s,startup_view_census_hardware1.17s)/O2(--preset release):cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_view_census -- -j 2):1.31s(configure0.00s)ctest --preset release -R '^startup_view_census' --parallel 4 --no-tests=error --output-on-failure): 6/6 passed (0.65s:startup_view_census_off_warp0.24s,startup_view_census_off_hardware0.04s,startup_view_census_vary_warp0.37s,startup_view_census_warp0.47s,startup_view_census_hardware0.52s,startup_view_census_vary_hardware0.25s)sccache: 6/6 hits; wall8.4sAI-assisted; commands listed were executed locally.