pe_shader_containers: parse and validate multi-image container layouts #53

Open
github-bot wants to merge 2 commits from github-bot/gh-53 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:08 UTC · original
ubiquitarianism:old-pr/9775 → main · +86 −9 · 2 files · 2 commits · draft

Carried over from old PR 9775 by abnalstlll-byte in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9775, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
abnalstlll-byte: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Parse and validate multi-image shader container layouts in \ ools/pe_shader_containers.py.

What and why

PE shader containers can hold multiple shader stage images across distinct offset bounds. This PR:

  • Handles multi-image container layout parsing and boundary validation.
  • Adds comprehensive unit tests in \ ests/test_pe_shader_containers.py\ (21/21 pass).
  • Ensures deterministic layout extraction compliant with the \pe_loader\ contract.

Verification

  • \python -I tests/test_pe_shader_containers.py -v\ -> 21/21 tests pass.
  • \python -I scripts/check_no_game_data.py\ -> clean (zero game data).
  • \git diff --check\ -> clean.
  • Python standard library only, cross-platform compatible.

AI-assisted.

**@⁠Andretuta** on GitHub · 2026-11-24 02:08 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/53) `ubiquitarianism:old-pr/9775` → `main` · +86 −9 · 2 files · 2 commits · draft > Carried over from **old PR 9775** by `abnalstlll-byte` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9775`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `abnalstlll-byte`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Parse and validate multi-image shader container layouts in \ ools/pe_shader_containers.py\. ### What and why PE shader containers can hold multiple shader stage images across distinct offset bounds. This PR: - Handles multi-image container layout parsing and boundary validation. - Adds comprehensive unit tests in \ ests/test_pe_shader_containers.py\ (21/21 pass). - Ensures deterministic layout extraction compliant with the \pe_loader\ contract. ### Verification - \python -I tests/test_pe_shader_containers.py -v\ -> 21/21 tests pass. - \python -I scripts/check_no_game_data.py\ -> clean (zero game data). - \git diff --check\ -> clean. - Python standard library only, cross-platform compatible. AI-assisted.
Publish through a temp file + replace so a mid-write OSError leaves any prior complete JSON intact.

Co-authored-by: Cursor <[email protected]>
When multiple PE images are passed with --extract, each image previously
invoked extract() starting from index 0. Unnamed containers (
ame=None)
in subsequent images collided on container_00, resulting in duplicate

ame keys in the output index.json.

Thread start_index=len(index) through multi-image extraction so stems
and index entries remain unique, and use strerror on write failures.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:42:26 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 08:02 UTC · original

Verified clean and ready for review: 21/21 tests pass under python -I tests/test_pe_shader_containers.py -v, zero game data, deterministic multi-image container layout parsing.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 08:02 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/53#issuecomment-7125661216) Verified clean and ready for review: 21/21 tests pass under python -I tests/test_pe_shader_containers.py -v, zero game data, deterministic multi-image container layout parsing.
This pull request has changes conflicting with the target branch.
  • tests/test_pe_shader_containers.py
  • tools/pe_shader_containers.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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