bvh_tri_probe: harden --oracle/--kernel, upfront atomic JSON writes, and oracle error handling (BVH-TRI-PROBE-JSON-AND-CLI) #2130
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2130
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/bvh-tri-probe-json-and-cli"
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?
Pull request successfully merged and closed
Summary
Hardens
tools/bvh_tri_probe.pyargument handling, JSON reporting, and hardware oracle execution:--oraclevalidation: Rejects empty strings, whitespace, and malformed comma-separated tokens (e.g.translator,or,hw) upfront with clear diagnostic exit code 2.--hw-archplumbing: Adds--hw-archCLI parameter, validates against empty/whitespace values, and passesarchtorunner.open_oracle(arch=...).--kerneltoken sanitation: Validates repeatable--kerneloptions and comma-separated kernel lists, rejecting empty/whitespace tokens upfront and deduplicating kernel selection.validate_json_path()) to catch non-file destinations, trailing slashes, or missing/non-directory parents before running kernels. Implementswrite_report()to write JSON atomically via tempfile replacement with consistent LF line endings and proper file modes.RuntimeError, and ensures oracle resources are closed viafinally.tests/test_bvh_tri_probe.pycovering all new CLI validation paths, atomic JSON writing, and oracle error/skip paths (27/27 tests pass).Verification
Claimed in #1608 (
BVH-TRI-PROBE-JSON-AND-CLI).AI-assisted (Claude Code, Claude Opus 5.5).
Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. With this PR, python -I tests/test_bvh_tri_probe.py: 27 tests OK. The PR's test file against main's tool: 1 failure and 7 errors, so the new tests fail on main and pass with the change. compileall clean.
AI-assisted: yes (Claude Code)
RUN: #2130 (tests only, python -I, no build, no game, GPU not used)
Tested heads: PR head 6d2b62628, main b6bf3aa0b (fetched 2026-11-29).
Commands (from each worktree root, CPython 3.13.12):
Red: PR head with tools/bvh_tri_probe.py reverted to its merge-base version (tests kept): 27 tests, FAILED (failures=1, errors=7). Same kind of red as the PR describes (new CLI/JSON validation paths missing). The PR's test file on plain main also fails (failures=1, errors=6).
Green at head: 27 tests OK; --self-test OK.
Green merged into main: NOT RUNNABLE.
git merge pr-2130into main b6bf3aa0b conflicts in tools/bvh_tri_probe.py (3 hunks). Main already has 0a2e5d92c (#1546) touching the same file after the PR's merge base; GitHub also reports the PR as CONFLICTING. Plain main: tests/test_bvh_tri_probe.py 22 tests OK, --self-test OK.So: green at head, red verified, needs a rebase on main before it can be green merged.
Machine: Windows 11 Pro 10.0.26300, CPython 3.13.12, GPU not used.
@abnalstlll-byte this PR now conflicts with
main(tools/bvh_tri_probe.py). Could you mergemaininto your branch (no force-push needed)? It was verified before the conflict: https://github.com/ProjectLeonida/mandy/pull/2130#issuecomment-7250768052. If there's no update within 24 h, OreoFR may carry it in a new PR that keeps you as co-author (per the maintainers' plan). — OreoFR's agent (AI-assisted)Carried as #2717 because of the conflict with main after #2566; @abnalstlll-byte, if you come back, say so and the carry is dropped.