OLD-7301: psin_psch: reject overlapping PMAP blocks and duplicate consumed sections #873
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/873"
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 narekshaghoyandev on 2026-11-24T14:52:46Z.
Reopening my original upstream PR #7301 (previously approved by
@devnull34, refined per@SirKingg's review, and re-verified 57/57 on retail PSIN streams by@Kev-Ball), cleanly rebased ontomain:PMAPblocks: Sorts non-empty (length > 0)PMAPblocks by offset and rejects any true byte-range overlap regardless of table row order (allowing empty blocks and non-monotonic non-overlapping rows).PMAP,PSCH,PSIG,STNS,STDN,STFN) instead of silently overwriting earlier sections in the section dict, while allowing repeated unknown/ignored section tags.Verification
python3 -I tests/test_psin_psch.py -v: 4/4 pass (negative control onmainfails ontest_rejects_overlapping_pmap_blocks_and_duplicate_known_sections).python3 -I scripts/check_no_game_data.py tools/psin_psch.py tests/test_psin_psch.py: clean.python3 -m compileall -q tools/psin_psch.py tests/test_psin_psch.py: clean.Claimed in the coordination issue as: OLD-7301 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135073380)
AI-assisted: yes (Gemini)
Imported from ubiquitarianism/leonida. Originally posted by KernelSmoker on 2026-11-24T14:56:53Z.
Review: APPROVED
Reviewed exact head
f16674ec39787400cf9b18dea36e1d0116a7ce81against base8f05e09e224656740e8a53f5047e1338d7a52588. PMAP blocks are checked as half-open byte ranges after sorting non-empty entries, preserving disjoint out-of-order/empty blocks; duplicate rejection is limited to sections the parser consumes, while unknown repeated sections remain accepted.python3 -I tests/test_psin_psch.py -vpasses 4/4; Python compilation andgit diff --checkpass. All fixtures synthetic; CPU-only. Hosted checks were pending at review time.Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T14:57:01Z.
Review: APPROVED
Audited and verified. Rejects overlapping non-empty PMAP blocks in ools/psin_psch.py:decode_pmap and raises ValueError on duplicate consumed sections in parse_psch_container rather than silently overwriting. Unit tests in ests/test_psin_psch.py pass cleanly. Approved.
Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T21:04:05Z.
Merging.
Why merged: OLD-7301: psin_psch rejects overlapping non-empty PMAP blocks and duplicate consumed sections, so malformed input is refused instead of misread. KernelSmoker approved this exact head.
Why it's good: Pure parsing. Own tests: 4 passed.
Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main
66d4f5aa3. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 573 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main0b45fdc21: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls, new env vars or build/CI changes.AI-assisted (Claude Code, Claude Opus 5.5).