turing_atlas: handle BOM/deep JSON, bool/unhashable deviceType, OSError/None stderr, and atomic --out (TURING-ATLAS-VALIDATION-AND-ATOMIC-IO) #1586

Merged
leonida/mandy
quietfold merged 1 commit from fix/turing-atlas-validation-and-atomic-io into main 2026-11-28 10:21:50 +00:00

Pull request successfully merged and closed

quietfold commented 2026-11-25 05:14:19 +00:00

Item: TURING-ATLAS-VALIDATION-AND-ATOMIC-IO (unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touch tools/turing_atlas.py).

Summary

  • Fix TypeError: 'NoneType' object is not subscriptable in validate_cases() when spirv-as fails with stderr=None, and report "missing" when spirv-val fails to launch (rv is None); catch OSError (including PermissionError) in run() rather than only FileNotFoundError.
  • Read VP_VULKANINFO_*.json with utf-8-sig (handling Windows UTF-8 BOM) and skip RecursionError on malformed deeply nested JSON instead of aborting vulkan_matrix().
  • Reject whitespace-only deviceName in _extract_profile() and guard deviceType lookup in _device_rank() to type(dtype) in (int, str) so unhashable values do not raise TypeError and bool (True == 1) does not falsely rank as VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU.
  • Publish --out atomically via file_mode.published_mode + replace_retry.replace (leaving any previous atlas intact on write failure and keeping direct writes for non-regular targets), enforce allow_nan=False, and accept optional argv=None in main().

Verification

  • python3 -W error -I tests/test_turing_atlas.py -v: 21/21 passed.
  • python3 -I tools/turing_atlas.py --help: passed.
  • python3 -I tests/test_text_write_line_endings.py: 3/3 passed.
  • python3 -I scripts/check_no_game_data.py tools/turing_atlas.py tests/test_turing_atlas.py: passed.
  • python3 -m compileall -q tools/turing_atlas.py tests/test_turing_atlas.py: passed.
  • Mutation check (running the new test suite against unpatched main:tools/turing_atlas.py): failures=2, errors=3 across all 5 new regression tests.

AI-assisted: yes
GPUs tested: none (synthetic vulkaninfo/SPIR-V mocks only, no game data)

Item: `TURING-ATLAS-VALIDATION-AND-ATOMIC-IO` (unclaimed — coordination issue #14 is at GitHub's 2,500-comment cap with no successor open issue yet, and 0 open PRs touch `tools/turing_atlas.py`). ### Summary - Fix `TypeError: 'NoneType' object is not subscriptable` in `validate_cases()` when `spirv-as` fails with `stderr=None`, and report `"missing"` when `spirv-val` fails to launch (`rv is None`); catch `OSError` (including `PermissionError`) in `run()` rather than only `FileNotFoundError`. - Read `VP_VULKANINFO_*.json` with `utf-8-sig` (handling Windows UTF-8 BOM) and skip `RecursionError` on malformed deeply nested JSON instead of aborting `vulkan_matrix()`. - Reject whitespace-only `deviceName` in `_extract_profile()` and guard `deviceType` lookup in `_device_rank()` to `type(dtype) in (int, str)` so unhashable values do not raise `TypeError` and `bool` (`True == 1`) does not falsely rank as `VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU`. - Publish `--out` atomically via `file_mode.published_mode` + `replace_retry.replace` (leaving any previous atlas intact on write failure and keeping direct writes for non-regular targets), enforce `allow_nan=False`, and accept optional `argv=None` in `main()`. ### Verification - `python3 -W error -I tests/test_turing_atlas.py -v`: 21/21 passed. - `python3 -I tools/turing_atlas.py --help`: passed. - `python3 -I tests/test_text_write_line_endings.py`: 3/3 passed. - `python3 -I scripts/check_no_game_data.py tools/turing_atlas.py tests/test_turing_atlas.py`: passed. - `python3 -m compileall -q tools/turing_atlas.py tests/test_turing_atlas.py`: passed. - Mutation check (running the new test suite against unpatched `main:tools/turing_atlas.py`): `failures=2, errors=3` across all 5 new regression tests. AI-assisted: yes GPUs tested: none (synthetic vulkaninfo/SPIR-V mocks only, no game data)
copilot-pull-request-reviewer[bot] reviewed 2026-11-25 05:14:29 +00:00
copilot-pull-request-reviewer[bot] left a comment
No description provided.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
MoonEyes commented 2026-11-28 10:21:32 +00:00

Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 18 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18). Targeted batch of 18 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.