Repository navigation
Conversation
KelboLive
left a comment
There was a problem hiding this comment.
tooling: add --assert-sites to the startup debugger
This is a clean, well-structured addition. The new --assert-sites N flag is a practical complement to --continue-asserts N — counting distinct sites instead of total hits will save users from running out of budget on repeat-hit assert paths like texture streaming.
Minor typo fix needed
File: tools/startup/debug_launch.py
The error message string on the continuation of the print call has a missing leading space:
print("expected numeric --timeout and --memory-gib values and integer --continue-asserts and "
"--assert-sites values")Consider ensuring the second line starts with a space for consistent formatting.
Everything looks good
- ✅ Validation:
assert_sites < 0properly guarded - ✅ Error messages updated to cover both flags
- ✅ PowerShell + shell + Python test harness all propagate the flag consistently
- ✅ Tests cover negative input, multiple sites, zero-site, and interaction with
X2W_STOP_AT - ✅ Documentation matches the implementation
- ✅ New flag added to
usage()in both run.ps1 and run.sh
Verdict: LGTM once the minor typo is addressed. Ready to merge.
|
Thanks for the review. The first string already ends with a space ( This reply was AI-assisted. |
KelboLive
left a comment
There was a problem hiding this comment.
PR #2916 by @pigalot -- tooling: add --assert-sites to the startup debugger
What works
- Solid foundational work establishing the 0x100 linear layout in gfx10_layout.h with careful derivation from AMD addrlib
- The linear_mode = 0 constant elegantly extends block_log2() to accept mode 0 without changing the tiled modes switch logic
- supports() check is correct: mode == linear_mode bypasses the block_log2 >= 12 requirement since linear has no tail
- Test infrastructure is excellent -- linear_order_control (expected failure with largest mip first), linear_addrlib (338K element addresses), and the unpadded negative control all add strong coverage
- Documentation accurately restates addrlib's linear mode algorithm in clear, testable terms
Issues
- supports() currently allows block-compressed formats (BC1-BC7) in linear mode via the fallthrough -- BC formats are block-based and don't have linear row semantics; consider gating them out explicitly like 1D does in #2929
- The check script in startup_address_console_check.py builds linear backing bytes from addrlib equations. This is correct but the linear path could break if the hardcoded equations drift from addrlib; a comment linking to the Mesa commit that derives these equations would help
Recommendations
- Good discipline in including the negative control (unpadded rows test) to verify the 256-byte pitch requirement
- Consider adding a TODO or assert in supports() that blocks linear mode for BC formats until explicitly validated against addrlib
Overall
A well-researched, well-tested implementation. The linear layout extension is cleanly separated from tiled modes. Minor concern about BC format handling in linear mode, but the existing refusal behavior is safe. Ready for merge.
R0Y00
left a comment
There was a problem hiding this comment.
The two budgets share asserts_seen, so the total-hit allowance can revoke a site that the distinct-site allowance already covers. I evaluated the exact predicate from 06b3df15 with sites A, B, A and --assert-sites 1 --continue-asserts 2. It continued A, continued B, then stopped at A. A is the first admitted site and should keep continuing under the stated rule that either budget can permit a hit.
Please keep the sites admitted by the site budget separately from the total-hit bookkeeping and add a combined-budget fixture that revisits A after using the total-hit allowance on B. The existing tests cover each allowance on its own.
|
Thanks, confirmed. B went into 9de3826 keeps the two budgets apart: the site budget has its own set of admitted sites, and The probe can now revisit its first breakpoint (
This reply was AI-assisted. |
--continue-asserts N counts hits, so a soft assert that repeats runs the budget out and long runs need ever larger values. --assert-sites N steps over every hit at up to N distinct main-image int3 sites and stops at the first hit of one more site. run.ps1 -AssertSites and run.sh --assert-sites pass it through with 0 as the default.
Both budgets read asserts_seen, so a site the hit budget continued also filled a slot of the site budget. With hits A, B, A and --assert-sites 1 --continue-asserts 2, A and B continued and A's second hit stopped the run. Keep the sites the site budget admits in their own set and count only the hits the hit budget covers. Test: the probe can revisit its first breakpoint (STARTUP_DEBUG_PROBE_REVISIT=1); A, B, A with both budgets now runs to the end, and the control with the hit budget alone stops at A's second hit.
9de3826 to
3d4460f
Compare
--continue-asserts Nsteps over the first N main-imageint3hits in total. A soft assert that repeats uses that budget up, so a long run needs an ever larger number (runs on #870 pass-ContinueAsserts 200000), and once the budget runs out the next repeat of a known site stops the run.--assert-sites N(run.ps1 -AssertSites N,run.sh --assert-sites N) counts distinct sites instead. Every hit at up to N distinct main-imageint3sites is stepped over, however long the run is. The first hit at one more site still stops the run, so a new assert is still caught, andX2W_STOP_ATsites still stop. A hit is stepped over when either budget allows it, and each budget counts only the hits it covers: the site budget keeps its own set of admitted sites (the first N distinct ones), and--continue-assertscounts the hits at other sites. Used alone,--continue-assertskeeps its meaning.run.ps1andrun.shpass--assert-sites 0by default, so their behavior does not change.Refs #870
Tests
tests/startup_debug_check.py(core group), onstartup_debug_probewith its third site repeated 20 times:--assert-sites 3exits 0 and logs all 20 hits at the repeated site.--continue-asserts 3stops at the repeated site's second hit.--assert-sites 2stops at the first hit of the third site.X2W_STOP_ATon the second site still stops there under--assert-sites 3.--assert-sites -1is rejected.STARTUP_DEBUG_PROBE_REVISIT=1, so the hits are A, B, A):--assert-sites 1 --continue-asserts 2exits 0 with the breakpoints logged in that order. Control:--continue-asserts 2alone stops at A's second hit.startup_run_ps1_check.pyandstartup_run_sh_check.pycheck that-AssertSites/--assert-sitesreach the debugger.At 3d4460f (on fa754b0), rebased on main 98007de after cpp-migration merged (#3039). The one conflict, in
tests/startup_run_ps1_check.py, kept main's new-NativeShaderslines and added-AssertSites 2to the shared command. Windows 11 Pro 10.0.26200.startup_run_shskipped on this host (no wine).Negative control: with the site rule in
debug_launch.pydisabled,startup_debugfails at the--assert-sites 3case, because the run stops at the repeated site instead of exiting 0. With the predicate from the first commit (fa754b0) (both budgets readingasserts_seen),startup_debugfails at the combined case: the run stops at A's second hit (startup_debug_probe.exe+0x199c).This change was AI-assisted.