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

Open
github-bot wants to merge 1 commit from github-bot/gh-1586 into main AGit
Owner

@⁠IlyassRS3 on GitHub · 2026-11-25 05:14 UTC · original
IlyassRS3:fix/turing-atlas-validation-and-atomic-io → main · +166 −15 · 2 files · 1 commits · open

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)

**@⁠IlyassRS3** on GitHub · 2026-11-25 05:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1586) `IlyassRS3:fix/turing-atlas-validation-and-atomic-io` → `main` · +166 −15 · 2 files · 1 commits · open 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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:57:19 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 05:14 UTC · original · reviewed

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.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-25 05:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1586#pullrequestreview-6052191275) · **reviewed** 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1586/head:github-bot/gh-1586'
git switch 'github-bot/gh-1586'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1586'
git switch 'github-bot/gh-1586'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1586'
git switch 'github-bot/gh-1586'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1586'
git switch 'main'
git merge --squash 'github-bot/gh-1586'
git switch 'main'
git merge --ff-only 'github-bot/gh-1586'
git switch 'main'
git merge 'github-bot/gh-1586'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.