Skip to content

startup: count acceleration-structure refusals by name in the slot 70 census - #2808

Merged
tedin7 merged 1 commit into
R0Y00:mainfrom
RenzoWit35:startup/memory-srv-census-as-reasons
Nov 26, 2026
Merged

tedin7 merged 1 commit into
R0Y00:mainfrom
RenzoWit35:startup/memory-srv-census-as-reasons

Conversation

@RenzoWit35

Copy link
Copy Markdown
Contributor

Change

publish_as_srv in src/startup_stubs/d3d12_memory_srv.inl passes as_srv_refusal_name(refusal) (as_unaligned, as_not_placed, as_wrong_state) to refuse_memory_srv, which calls memory_srv_census.note. Neither memory_srv_reasons (memory_srv_census.h) nor SLOT70_REASONS (tools/startup/triage_run.py) listed them, so both reports folded them into "other".

  • Add the three names to both tables, after gpu_written_resource and before buffer_unavailable (the order device_memory_srv reaches them), with a group comment in the style of the existing ones.
  • memory_srv_reason_has_shape: the three reasons keep no shape. The acceleration-structure path does not read the resource description (memory_srv_refusal skips the readability check for such a view, and resolve_as_srv_desc takes only the location and view), so a "shape" built from it would describe whatever the caller left in that argument. This matches the existing exclusions for reasons that do not depend on the description. Question for review: if you would rather keep shapes for these, drop the three extra lines in memory_srv_reason_has_shape.
  • Update the expected report line in tests/startup_memory_srv_census_check.cpp and tests/startup_memory_srv_diag_check.py, and the sentence in docs/startup-runtime.md that lists the reasons without a shape.
  • The census report line gains three counters, so indexes after gpu_written_resource shift by three. Nothing uses the indexes outside memory_srv_census.h (lookups are by name).

Verification

  • Reachability: git grep -n -e refuse_memory_srv -e as_srv_refusal_name -- src on origin/main. Every reason the .inl can log: the 16 already listed, plus the three above. console_address_hold returns only console_layout_xg_rows, console_layout_without_footprints, console_layout_beyond_xg_size. No other name is missing from either list.
  • tests/startup_memory_srv_census_check.cpp (CTest startup_memory_srv_census): iterates every name as_srv_refusal_name returns (stops at "none"), requires an index below memory_srv_reason_count, no shape, and the name in a fresh report with other 0. The hard-coded summary line also changed.
  • tests/startup_triage_run_check.py: the three names added to the every-reason case list, plus a check that reads the names from memory_srv_as.h and requires them in SLOT70_REASONS.
  • Commands and results (worktree, fixed tree):
    • out\pe-env\Scripts\python.exe -B tests\startup_triage_run_check.py: startup triage_run checks: 0 failed.
    • cmake --build out/build/dev --target startup_memory_srv_census_check then ctest --test-dir out/build/dev -R '^startup_memory_srv_census$': passed.
    • cmake --build out/build/dev --target startup_stream_consumer then ctest -R '^startup_memory_srv_diag_(warp|supported_control_warp)$': both passed (this check parses the census report line).
  • Negative controls:
    • Python: with the three names removed from SLOT70_REASONS the check fails with 4 failures (reported list lacks them, three "SLOT70_REASONS lacks ..." lines).
    • C++: the new test compiled against git show origin/main:src/startup_stubs/memory_srv_census.h fails (3x "acceleration-structure refusal has its own census reason", "as_unaligned is reported by name", "summary").

Evidence and follow-up

AI-assisted.

… census

as_srv_refusal_name can return as_unaligned, as_not_placed and
as_wrong_state, and publish_as_srv passes them to refuse_memory_srv, but
neither memory_srv_reasons nor triage_run.py SLOT70_REASONS listed them, so
the census report and the triage report counted them as "other".

List them after gpu_written_resource (where publish_as_srv checks them) in
both tables, keep no resource shape for them (that path never reads the
resource description), and update the report-line expectations. The census
test now derives the names from as_srv_refusal_name.

@tedin7 tedin7 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.

Review of head 68fdf7e (comment only).

Checked against origin/main:

  • The three names match as_srv_refusal_name in memory_srv_as.h exactly (as_unaligned, as_not_placed, as_wrong_state); order in memory_srv_reasons and SLOT70_REASONS matches.
  • No shape for these reasons is consistent with the existing exclusions: the acceleration-structure path does not read the resource description. Fine to keep as is.
  • Both new tests guard the behavior: the C++ test enumerates names from as_srv_refusal_name, and the Python test reads them from the header, so a fourth refusal that is not listed fails.
  • No sibling table left out: only memory_srv_census.h and triage_run.py hold the list; the summary line in the C++ test and the docs sentence were updated.
  • No other open or merged PR covers this slice (searched "acceleration-structure census").

Commands run locally (Linux):

  • python3 tests/startup_triage_run_check.py -> 0 failed
  • python3 tests/docs_links_check.py -> ok; python3 tests/bidi_controls_check.py -> ok; git diff --check origin/main...HEAD -> clean
  • Mutation: removing as_wrong_state from SLOT70_REASONS makes startup_triage_run_check.py fail (2 failures); restored afterwards.

Not run here: the C++ census test (needs the Windows build); a Win2025 run follows.

AI-assisted; commands listed were executed locally.

@tedin7

tedin7 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Win2025 WARP receipt for head 68fdf7e (no update needed, up to date).

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit 68fdf7ec18c06b1c72b22594beaa0b93364002d0:

  • Debug (--preset dev):
    • Build (cmake --build --preset dev --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_census_check startup_stub_xcrdapi -- -j 2): 30.36s (configure 2.27s)
    • Test (ctest --preset dev -R 'startup_memory_srv_census|startup_memory_srv_diag|startup_triage_run' --parallel 6 --no-tests=error --output-on-failure): 6/6 passed (3.46s: startup_memory_srv_census 0.02s, startup_triage_run 0.67s, startup_memory_srv_diag_supported_control_warp 0.79s, startup_memory_srv_diag_warp 0.78s, startup_memory_srv_diag_hardware 0.83s, runtime_startup_triage_run_cli_check 3.29s)
  • Release /O2 (--preset release):
    • Build (cmake --build --preset release --target d3d12_xs_device_obj d3d12_xs_shim startup_memory_srv_census_check startup_stub_xcrdapi -- -j 2): 50.63s (configure 1.93s)
    • Test (ctest --preset release -R 'startup_memory_srv_census|startup_memory_srv_diag|startup_triage_run' --parallel 6 --no-tests=error --output-on-failure): 6/6 passed (2.49s: startup_memory_srv_census 0.02s, startup_triage_run 0.46s, startup_memory_srv_diag_warp 0.64s, startup_memory_srv_diag_supported_control_warp 0.64s, startup_memory_srv_diag_hardware 0.65s, runtime_startup_triage_run_cli_check 2.35s)
  • Windows Python checks: tests/startup_triage_run_check.py ok (0.4s)
  • sccache: 2/16 hits; wall 93.7s

Real-GPU run not available (RunPod stopped).

AI-assisted; commands listed were executed locally.

@tedin7
tedin7 merged commit e2271cc into R0Y00:main Nov 26, 2026
5 checks passed
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.

2 participants