[PR #873] [MERGED] OLD-7301: psin_psch: reject overlapping PMAP blocks and duplicate consumed sections #912

Closed
opened 2026-11-26 20:19:28 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/873
Author: @narekshaghoyandev
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD

Base: main ← Head: ubiq-psin-psch-pmap-overlap-and-dup-sections


📝 Commits (1)

  • f16674e psin_psch: reject overlapping PMAP blocks and duplicate consumed sections

📊 Changes

2 files changed (+50 additions, -1 deletions)

View changed files

📝 tests/test_psin_psch.py (+33 -0)
📝 tools/psin_psch.py (+17 -1)

📄 Description

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 onto main:

  1. Reject overlapping non-empty PMAP blocks: Sorts non-empty (length > 0) PMAP blocks by offset and rejects any true byte-range overlap regardless of table row order (allowing empty blocks and non-monotonic non-overlapping rows).
  2. Reject duplicate consumed sections: Rejects duplicate occurrences of the 6 consumed PSIN section tags (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 on main fails on test_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)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/873 **Author:** [@narekshaghoyandev](https://github.com/narekshaghoyandev) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `ubiq-psin-psch-pmap-overlap-and-dup-sections` --- ### 📝 Commits (1) - [`f16674e`](https://github.com/ubiquitarianism/leonida/commit/f16674ec39787400cf9b18dea36e1d0116a7ce81) psin_psch: reject overlapping PMAP blocks and duplicate consumed sections ### 📊 Changes **2 files changed** (+50 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_psin_psch.py` (+33 -0) 📝 `tools/psin_psch.py` (+17 -1) </details> ### 📄 Description 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 onto `main`: 1. **Reject overlapping non-empty `PMAP` blocks**: Sorts non-empty (`length > 0`) `PMAP` blocks by offset and rejects any true byte-range overlap regardless of table row order (allowing empty blocks and non-monotonic non-overlapping rows). 2. **Reject duplicate consumed sections**: Rejects duplicate occurrences of the 6 consumed PSIN section tags (`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 on `main` fails on `test_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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:19:28 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#912
No description provided.