Skip to content

xdxr_bvh: a check-build folder that does not exist is one ERROR line and exit 2, not the 77 skip (EGEN-XDXR-CHECKBUILD-DIR) - #8333

Closed
evilclanker9000 wants to merge 2 commits into
ProjectLeonida:mainfrom
evilclanker9000:deepseek/3-xdxr-checkbuild-dir
Closed

evilclanker9000 wants to merge 2 commits into
ProjectLeonida:mainfrom
evilclanker9000:deepseek/3-xdxr-checkbuild-dir

Conversation

@evilclanker9000

Copy link
Copy Markdown
Contributor

What and why

tools/xdxr_bvh.py check-build distinguishes a build folder from a path that does not exist by how many .bin cases it holds. A folder that is not there holds no cases, so it took the same branch as a build step that ran and wrote nothing:

$ python -I tools/xdxr_bvh.py check-build .\no-such-build-folder
no cases in .\no-such-build-folder: skipped (the build step skipped or did not run)
$ echo $LASTEXITCODE
77

Exit 77 is the ctest SKIP_RETURN_CODE, so a mistyped path (or a folder that was moved) passed as a deliberate skip, and the message blamed the build step. Every other input error in this tool is exit 2 with one ERROR: line (check-build's own case errors at tools/xdxr_bvh.py:1051, validate's unreadable file), and BUILD-1046 asks for exactly that.

The guard tests os.path.isdir(a.dir) before the case scan. An existing folder with no cases keeps the 77 skip.

$ python -I tools/xdxr_bvh.py check-build .\no-such-build-folder
ERROR: .\no-such-build-folder is not a folder
$ echo $LASTEXITCODE
2

Test

tests/test_xdxr_bvh.py gains two cases in the existing Cli class: the missing folder is exit 2 with exactly one ERROR: line that names the path and no traceback, and an existing empty folder still returns 77 with the skip line.

python -I tests/test_xdxr_bvh.py
  • Before, on 47428cc22 with only the test added: FAILED (failures=1), AssertionError: 77 != 2, Ran 49 tests.
  • After: Ran 49 tests in 1.746s, OK.

python -m compileall -q tools/xdxr_bvh.py tests/test_xdxr_bvh.py exits 0. python -I scripts/check_no_game_data.py tools/xdxr_bvh.py tests/test_xdxr_bvh.py exits 0.

No GPU needed, no game files: the tests use tempfile.TemporaryDirectory() only.

Notes

  • The guard is placed in main()'s check-build branch rather than in check_build(), so the library function keeps its current contract (an empty case list is ["no cases in <dir>"]) and the two existing library-level tests are unchanged.
  • The message follows the tool's own ERROR: <what> form used two lines below; it does not repeat the full OS error because there is no OS call involved.
  • validate's unreadable-file message (error: ..., lowercase) is left alone: it is a separate path and not part of this item.

Item: EGEN-XDXR-CHECKBUILD-DIR (finding and claim posted in #8186).

AI-assisted.

…ne ERROR line)

A mistyped or removed folder was read exactly like a build that wrote no cases: 'no cases in <dir>: skipped (the build step skipped or did not run)' with exit 77, the ctest skip code, so a wrong path passed as a clean skip. An existing folder with no cases keeps the 77 skip.
…empty one still skips

The missing-folder test fails on the old main with '77 != 2' (AssertionError in Cli.check_build_stderr) and passes with the guard; the empty-folder test keeps the 77 ctest skip for a build that ran and wrote nothing.
@molodayamama

Copy link
Copy Markdown
Contributor

Verified commit 2330b2af8aae87c4dd6d3dbaafe410f99cdad542. All 49 BVH tool tests passed on Windows. I also invoked the actual check-build CLI on a regular file, which returned 2 with one is not a folder diagnostic and preserved the file bytes. The same command on an existing empty directory returned the expected 77 skip.

AI-assisted verification.

@ne1i

ne1i commented Nov 23, 2026

Copy link
Copy Markdown

Tested 2330b2af on Linux, CPython 3.14, CPU only, synthetic inputs, merged onto main 46492b02: pass

  • python -I tests/test_xdxr_bvh.py: Ran 49 tests, OK. With only the non-test files reverted to main: FAILED (failures=1), so the new tests exercise the change.
  • compileall and scripts/check_no_game_data.py on the changed files: clean.

Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting; claimed in #8047.

@garuspl

garuspl commented Nov 23, 2026

Copy link
Copy Markdown

Tested 2330b2a on Windows 11 (CPU only, no GPU needed): pass

Windows 11 Pro, Python 3.14.7, no GPU or game files involved; pytest/numpy/Pillow pinned from tests/requirements.txt in a fresh venv. Method: PR head merged onto main d9aa42a, the PR's test files run with python -m pytest before and after the merge, plus python -m compileall -q on the changed files (clean).

  • tests/test_xdxr_bvh.py: main 47 passed, 7 subtests passed; with the PR 49 passed, 7 subtests passed.

AI-assisted (Claude Code, Claude Opus 5.5).

@Atomic258

Copy link
Copy Markdown
Contributor

Tested 2330b2af on Windows Server 2022, CPython 3.13.12 / Node 24: pass

  • python -I tests/test_xdxr_bvh.py -> OK

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

@wildheathen

Copy link
Copy Markdown
Contributor

Tested 2330b2af8 on Windows 11, Python 3.14 (CPU only): pass.

Security pass first: clean. The diff is os.path.isdir plus one error line in tools/xdxr_bvh.py, and two tests on temporary directories.

  • python -I tests/test_xdxr_bvh.py: 49 tests OK.
  • CLI: a missing folder prints ERROR: ... is not a folder and exits 2. An existing empty folder still prints the skip line and exits 77.
  • ctest consumers: a GPU-less runner must still skip, so I checked every check-build call in runtime/CMakeLists.txt for its folder. xdxr_build_check and d3d12_xdxr_rt_check read folders that CMake creates at configure time (file(MAKE_DIRECTORY ...)), so they keep the 77 skip when the producer skips. runtime: serve XboxBvhBuilder.dll with the layer's XDXR builder (RT-5, boot stop 18) #7516 adds a third consumer (xbox_bvh_builder_check) without file(MAKE_DIRECTORY), but its test creates the folder before any of its 77 exits, so that one keeps the skip too.

AI-assisted.

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.

7 participants