tests: sgpr census folding-volume case survives Windows realpath case (TEST-WIN-SWEEP) #368

Merged
leonida/mandy
ItsMrDubey merged 1 commit from win-realpath-case-census into main 2026-11-24 14:53:59 +00:00

Pull request successfully merged and closed

ItsMrDubey commented 2026-11-24 03:57:43 +00:00

Claimed in the coordination issue as: TEST-WIN-SWEEP (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121328982)

What and why

python -m pytest tests/test_user_sgpr_census.py fails on Windows in test_json_report_refuses_to_overwrite_index[folding-volume-case]: Expected 'mock' to have been called once. Called 0 times. The case writes index.json and passes INDEX.JSON as --json to simulate a case-folding volume, patching _resolved_key and os.path.samefile so only the _same_resolved_name probe can catch the collision. On Windows os.path.realpath returns an existing file's name as it is stored, so INDEX.JSON resolves to ...\index.json, the two keys already match and the probe is never asked. The tool did refuse the overwrite (exit 2), only by the other route; the test was wrong, not the code.

The case now also patches realpath with os.path.abspath, as tests/test_wave64_graphics_scan.py and tests/test_psin_names.py already do for the same simulation, so the spelling reaches the probe on every OS.

Tested

Windows 11, Python 3.11.9 and 3.12.9:

  • py -3.12 -m pytest tests/test_user_sgpr_census.py: before 1 failed, 43 passed; after 44 passed. Same with Python 3.11.9.
  • python -I scripts/check_no_game_data.py tests/test_user_sgpr_census.py: clean.
  • Linux/macOS: realpath never changed the case there, and tmp_path gives both names one parent, so abspath yields the same pair as before.

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. n/a: no translator rule
Claimed in the coordination issue as: TEST-WIN-SWEEP (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121328982) ### What and why `python -m pytest tests/test_user_sgpr_census.py` fails on Windows in `test_json_report_refuses_to_overwrite_index[folding-volume-case]`: `Expected 'mock' to have been called once. Called 0 times.` The case writes `index.json` and passes `INDEX.JSON` as `--json` to simulate a case-folding volume, patching `_resolved_key` and `os.path.samefile` so only the `_same_resolved_name` probe can catch the collision. On Windows `os.path.realpath` returns an existing file's name as it is stored, so `INDEX.JSON` resolves to `...\index.json`, the two keys already match and the probe is never asked. The tool did refuse the overwrite (exit 2), only by the other route; the test was wrong, not the code. The case now also patches `realpath` with `os.path.abspath`, as `tests/test_wave64_graphics_scan.py` and `tests/test_psin_names.py` already do for the same simulation, so the spelling reaches the probe on every OS. ### Tested Windows 11, Python 3.11.9 and 3.12.9: - `py -3.12 -m pytest tests/test_user_sgpr_census.py`: before 1 failed, 43 passed; after 44 passed. Same with Python 3.11.9. - `python -I scripts/check_no_game_data.py tests/test_user_sgpr_census.py`: clean. - Linux/macOS: `realpath` never changed the case there, and `tmp_path` gives both names one parent, so `abspath` yields the same pair as before. AI-assisted: yes ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. n/a: no translator rule
sodove commented 2026-11-24 06:18:16 +00:00

Independent Windows integration check of 608a24a1cd7cdabb7ac4bf839a99272fa2496fb0. Windows 11 build 26100, Python 3.12, pytest 9.2.0.

  • Current main 8f481cf had the reported assertion failure (43 passed, 1 failed). With this test commit applied to main, all 44 passed.
  • The same commit also applied cleanly to #490 at 448dae0f. All 44 SGPR census tests passed there, along with 10/10 real NTFS cases on synthetic files and 35/36 report-path tests (one APFS-only case skipped).

This verifies the test correction with either version of same_report_path. CPU-only, synthetic files. AI-assisted verification.

Independent Windows integration check of 608a24a1cd7cdabb7ac4bf839a99272fa2496fb0. Windows 11 build 26100, Python 3.12, pytest 9.2.0. - Current main 8f481cf had the reported assertion failure (43 passed, 1 failed). With this test commit applied to main, all 44 passed. - The same commit also applied cleanly to #490 at 448dae0f. All 44 SGPR census tests passed there, along with 10/10 real NTFS cases on synthetic files and 35/36 report-path tests (one APFS-only case skipped). This verifies the test correction with either version of same_report_path. CPU-only, synthetic files. AI-assisted verification.
quartz-heron-58 commented 2026-11-24 08:28:38 +00:00

Tested 608a24a1 (cherry-picked onto main 1c93c869) on native Windows 11 Home (build 26300), Python 3.12.10, pytest 9.2.0 (the pins in tests/requirements.txt, in a virtual environment): pass.

On main 1c93c869, python -m pytest tests/test_user_sgpr_census.py fails test_json_report_refuses_to_overwrite_index[folding-volume-case] here: the tool refuses the overwrite as it should, but the probe mock is called 0 times. With this commit the file gives 44 passed. No game files.

AI-assisted (Claude Code ran the tests and wrote this comment).

Tested 608a24a1 (cherry-picked onto main 1c93c869) on native Windows 11 Home (build 26300), Python 3.12.10, pytest 9.2.0 (the pins in `tests/requirements.txt`, in a virtual environment): pass. On main 1c93c869, `python -m pytest tests/test_user_sgpr_census.py` fails `test_json_report_refuses_to_overwrite_index[folding-volume-case]` here: the tool refuses the overwrite as it should, but the probe mock is called 0 times. With this commit the file gives 44 passed. No game files. AI-assisted (Claude Code ran the tests and wrote this comment).
QemmHD commented 2026-11-24 14:53:57 +00:00

Merging.

Why merged: Fixes a Windows-only test failure: realpath case-folds INDEX.JSON there, so the sgpr-census folding-volume test now patches realpath. Independent Windows passes from sodove and quartz-heron-58, with no open requests.

Why it's good: Test-only change. tests/test_user_sgpr_census.py: 44 passed.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 47c651174, where the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 566 passed / 5 skipped / 0 failed with this PR in. git merge-tree against current main 8f05e09e2: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

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

Merging. **Why merged:** Fixes a Windows-only test failure: realpath case-folds INDEX.JSON there, so the sgpr-census folding-volume test now patches realpath. Independent Windows passes from sodove and quartz-heron-58, with no open requests. **Why it's good:** Test-only change. tests/test_user_sgpr_census.py: 44 passed. Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 47c651174, where the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 566 passed / 5 skipped / 0 failed with this PR in. git merge-tree against current main 8f05e09e2: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes. AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No description provided.