Commit Graph

6 Commits

Author SHA1 Message Date
9520fea3a5 Merge origin/main into #2130 (carry prep)
tools/bvh_tri_probe.py: PR's --kernel expansion, validate_json_path, family check and r.get('lane') kept with main's --write-kernels check, skipped-row count and skip note; write_report now writes through main's _write_text_atomic; the skipped count reads r.get("status") like the PR's r.get("lane").

Co-authored-by: abnalstlll-byte <284980532+abnalstlll-byte@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 09:41:09 +01:00
6d2b626281 bvh_tri_probe: harden --oracle/--kernel, upfront atomic JSON writes, and oracle error handling (BVH-TRI-PROBE-JSON-AND-CLI)
- Validate --oracle tokens and reject empty or whitespace components upfront.
- Add --hw-arch CLI option, validating and plumbing it to runner.open_oracle().
- Validate and split --kernel arguments with comma expansion, rejecting empty tokens.
- Add validate_json_path() to reject invalid paths, directory paths, and non-directory parents upfront.
- Add write_report() to write JSON atomically with LF line endings and proper file mode.
- Robustly resolve oracle family (handling ValueError) and safely close oracle resources.
- Guard against empty or missing hardware oracle results.
- Add comprehensive test coverage in tests/test_bvh_tri_probe.py (27 tests passing).

Tested:
- python -I tests/test_bvh_tri_probe.py (27/27 passed)
- python -I tools/bvh_tri_probe.py --self-test (passed)
- python -I scripts/check_no_game_data.py tools/bvh_tri_probe.py tests/test_bvh_tri_probe.py (clean)

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-26 01:16:14 +03:00
4cc96d1723 bvh_tri_probe: fix skipped-kernel compare/exit, check_kernel stores, and atomic I/O 2026-11-25 05:07:38 +01:00
23824592c1 bvh_tri_probe: name a --json directory as typed, not through repr() (#6708)
Squash-merged after diff review of PR #6708 - bvh_tri_probe: name a --json directory as typed, not through repr()
2026-11-23 10:01:41 -06:00
9574cc3c50 tests, tools: the measured tie rows of image_bvh (tri_t1..tri_t8) as regression rows and probe kernels
tests/semantic/test_image_bvh_tri_hw.py: the data block now also holds the 256 single-lane rows of the tie
measurement (RX 6800, gfx1030, AMD 26.11.2, 2026-11-23; hand-built nodes and rays, the words the instruction
returned, both forms equal), written by work-bvhtri/ties/export_hw_table_ties.py; the #4202 rows are unchanged.
The translator before the tie rule change fails 46 of the new rows (92 subtests) and none of the old ones.

tools/bvh_tri_probe.py: builds the eight tie kernels too (tri_t1..t7 x / y dominant and equal |d|, tri_t8 the z
bridge); their lines are those of the reviewed specs the RX 6800 ran (module_sha256 matches). rule_words follows
the new tie rule. tests/test_bvh_tri_probe.py pins tri_t1 and tri_t8 and expects 564 single-lane cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:40:54 -07:00
c297501ec1 tools: bvh_tri_probe.py, the RDNA2 triangle-node measurement of image_bvh as a probe
Builds the 14 tools/hw_oracle raw kernels of the RX 6800 measurement (308 single-lane cases, 7 cases on 64 lanes in
wave32 and wave64, NSA and contiguous operands), runs them one dispatch each through the in-tree runner and compares
both forms with the measured rule and, with --oracle translator,hw, with the translator on the mini interpreter. The
lines are the ones that ran: built into a module by asm.module_text they hash to the reviewed specs.

What a kernel may do is the measurement's safety review: nodes only in whole 64-byte slots of the node region inside
the oracle's buffer, with a guard band after it; a run-time check that the region is 256-byte aligned before any
BVH instruction; triangle node types only (no box nodes, no types 6/7, no extent rows) and one descriptor (w2 =
0xFFFFFFFF, w3 = 0x81000000); outputs refused when the control word is missing, a destination was never written or
everything is prefill. The DRM launcher's 4096-dword limit skips the lane kernels on Linux. The docstring has the
WSL clang-21 command lines the measurement assembled with (not tried through the tool itself).

tests/test_bvh_tri_probe.py (no GPU): the cases equal the rows of test_image_bvh_tri_hw.py, the rule gives their
measured words, three kernels' text is pinned, the safety checks refuse bad kernels, and a stand-in oracle with the
measured outputs passes (one planted word fails, prefill or a missing control word stops the run).

Co-Authored-By: Claude Opus <noreply@anthropic.com>
2026-11-22 20:39:50 -07:00