tests: test_mesh_alloc_single_writer inserts 'tools' by __file__, not cwd (TEST-MESHALLOC-SYSPATH) #1421
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1421"
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?
Imported from ubiquitarianism/leonida. Originally posted by thiefyzheng on 2026-11-24T23:50:36Z.
What
One line:
tests/test_mesh_alloc_single_writer.pyinserted'tools'onsys.pathrelative to the process working directory (sys.path.insert(0, 'tools'), the only relative insert intests/), soimport rdna2spirvon the next line worked only when the cwd was the repository root. It now derives the path from__file__, the same idiom the neighbouring test files use (e.g.tests/test_f32_fuzz.py,tests/test_psin_names.py).Claimed as TEST-MESHALLOC-SYSPATH on #14 (the finding is @GTAVIB4GTAVI's, at 23:47:17Z).
Why
python -I tests/test_mesh_alloc_single_writer.pyfrom the repo root passes, but the same command from any other cwd fails withModuleNotFoundError: No module named 'rdna2spirv'— and it is the oneImportErrorin arun_semantic_tests.py testsrun, because that runner starts each child withcwd=<suite folder>(scripts/run_semantic_tests.py:117).What I ran (Linux, CPython 3.12, no GPU, synthetic only)
364ab4eab: from the worktree root the file passes; from an unrelated cwd (/tmp, absolute path invocation) →ModuleNotFoundError: No module named 'rdna2spirv'(reproduced, quoted in the claim thread).Ran 1 test in 0.001s ... OK;python3 -m unittest tests.test_mesh_alloc_single_writer -valso passes.grepover tests/ and scripts/: no other file references this file's path behavior.scripts/check_no_game_data.pyexit 0.Not run
Not run on Windows (the change has no platform-specific behavior: both sides are pure
os.path); not run under CI — workflows will cover the file.AI-assisted: a pi coding agent operated by the repo contributor ran the verification and built the single-file diff; the finding is @GTAVIB4GTAVI's.
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T10:34:53Z.
Reviewed
80d1424: ranpython -I tests/test_mesh_alloc_single_writer.pyin the sandbox on both trees. Itpasses from the repo root on both; from any other cwd it fails on main (ModuleNotFoundError) and passes
with the PR, which is the intended fix and the idiom all neighbouring tests use — this file held the last
cwd-relative 'tools' insert. The PR's test file also passes copied onto main's tree, so the SHADER-766
assertions are unchanged. No findings.
AI-assisted review.
Recommendation: Merge
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:50:13Z.
Verified by OreoFR
3408969a7+ PR head80d142496python -I tests/test_mesh_alloc_single_writer.pyAI-assisted (Claude Code, Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:12:26Z.
#1421 | head
80d1424960(merged cleanly onto origin/main818d881b1f) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesIndependent Verification (Windows 11)
tests/test_mesh_alloc_single_writer.pyresolvingtools/relative toos.path.abspath(__file__)instead of a relative'tools'entry onsys.path.python -I scripts/check_no_game_data.py tests/test_mesh_alloc_single_writer.pypassed (rc=0).origin/main818d881b1f): Runningpython -I <repo>/tests/test_mesh_alloc_single_writer.pyfrom outside the repository root (%TEMP%working directory) failed withModuleNotFoundError: No module named 'rdna2spirv'(rc=1).#1421 + origin/main):python -I <repo>/tests/test_mesh_alloc_single_writer.pyfrom%TEMP%working directory ->1/1passed (OK,0.001s)python -I tests/test_mesh_alloc_single_writer.pyfrom repository root ->1/1passed (OK,0.001s).Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:18:45Z.
Ready for testing: merges cleanly with
main3535eb5c4. Not inmainyet:git cherryfinds 1 commit(s) not there, and 0 of the 2 lines it adds are already present. No duplicate found: its claimTEST-MESHALLOC-SYSPATHappears in no other open pull request and in nomaincommit.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T15:22:05Z.
RUN of #1421 (red/green,
python -I, no build, no game, no GPU)Heads tested: PR head
80d142496053, origin/mainc22a0a73228c; merged = main + PR head,git merge --no-ff, local only (merged cleanly, merge commit5a770e4ab816).The PR changes only the test file
tests/test_mesh_alloc_single_writer.py(one line:sys.path.insert(0, 'tools')becomes a path built from__file__), so there is no non-test change to revert. The red is the main version of that test file against the same tree, run from a folder other than the repo root. Commands, one process each:python -I tests/test_mesh_alloc_single_writer.py(cwd = repo root)python -I test_mesh_alloc_single_writer.py(cwd =tests/)python -I <abs path>/tests/test_mesh_alloc_single_writer.py(cwd = an unrelated folder)tests/and from an unrelated folder both exit 1,ModuleNotFoundError: No module named 'rdna2spirv'. This is a real red for the cwd dependence the PR fixes (behavioural: same code, other cwd), not a build failure.Machine: NVIDIA GeForce RTX 3090 (not used), Windows 11 Pro 10.0.26300, CPython 3.13.12.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T15:45:22Z.
Merged. Tested by @enlight3d on head
80d142496(CPU only (Windows 11; RTX 3090 unused)): Red: main test fails from non-root cwd (ModuleNotFoundError rdna2spirv); green: OK from 3 folders. Correction: no CI check run or commit status exists for this head, so CI did not validate it. My earlier sentence about red jobs was wrong. Thanks @thiefyzheng!AI-assisted: yes