Skip to content

fix: preserve NUP member names during implicit reads - #1185

Merged
hckrman101 merged 1 commit into
NotRexed:mainfrom
klimovich008:codex/preserve-nup-member-name
Nov 9, 2026
Merged

hckrman101 merged 1 commit into
NotRexed:mainfrom
klimovich008:codex/preserve-nup-member-name

Conversation

@klimovich008

@klimovich008 klimovich008 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What this fixes

Reading a raw .zs package member without supplying its filename can decompress the game file itself when compressed and decoded lengths happen to match. A prefix read then returns decoded payload bytes instead of the file's real header.

Why merge

  • Keep implicit reads and named copies consistent.
  • Preserve explicit outer-compression records and legacy executable-member detection.
  • Reuse the stored filename without adding another codec heuristic.

Change

  • nx2/nup.py: resolve omitted names in the shared packing classifier.
  • nx2/test_nup_read_name.py: check five synthetic compatibility cases and caller-supplied names.

Tested

python -I -B nx2/test_nup_read_name.py

Fails on the old code, passes now. Real Zstd decoding verifies the fixed 49-byte synthetic frame. Local Windows CPU-only checks cover raw .zs, explicit codec1, legacy exefs, plain exefs and nested .zs.

python -I -B tests/run_all.py --jobs 1 --strict nup

This command exits nonzero on the existing Windows symlink-privilege failures noted below. The new regression, codec and verification checks pass; 209 tracked Python files compile. Fresh Windows/Linux CI passes all five jobs, including the new regression.

Not covered

  • Real-package integration has not run for this commit.
  • On this local Windows setup, existing path-link tests fail with symlink privilege errors on both base and candidate.

No game data is included.

Resolve omitted names in the shared packing classifier so read and copy_to agree for raw .zs frames with equal compressed and decoded lengths.

Assisted-by: OpenAI Codex

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@hckrman101
hckrman101 merged commit 8676493 into NotRexed:main Nov 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant