Repository navigation
fix: add trailing newline to ps_oracle.py --json output (BUILD-1348) - #4673
MichaelL401 wants to merge 2 commits into
Conversation
|
Tested ed3a861 merged with main 0db7fed on WSL2 Ubuntu, Python 3.12.16: fail, for the same reason as #4660 (this PR contains that PR's crosslane_fuzz commit e7023cf).
Windows 11 (Python 3.13.1, .NET SDK 10.0.403 building the net8.0 Release DLL): the rpf9dump part passes: |
Kam471
left a comment
There was a problem hiding this comment.
Ran this at ed3a86187 on Windows 11: pytest tests/test_ps_oracle.py -q -> 19 passed, 1 skipped, 35 subtests passed; git diff --check clean.
The JSON output now ends with a newline, so jq/cat and the oracle's text tools see a terminated line. Stacking note: this branch also carries cace4a085 (the rpf9dump missing-source guard, #4636) and e7023cf6a (the --wave 32/64 default-mode fix, #4637's change). Both of those PRs are open separately, so merging this one lands their changes too; one of the copies should be dropped.
Kam471
left a comment
There was a problem hiding this comment.
The branch carries e7023cf6a (the crosslane --wave fix) without #4637's test update, so its tree fails tests/test_crosslane_fuzz.py: 2 failed, 52 passed (test_emulate_with_wave32_is_a_usage_error and test_wave64_native_without_w64_native_is_a_usage_error). If this PR merges as-is it will turn that suite red on main; #4637 (9e5cd1f8) is the complete fix (55 passed, 2 skipped). Please rebase onto #4637 or drop the carried commit. tests/test_ps_oracle.py is green (19 passed, 35 subtests).
|
Request changes - the one-line fix is right but nothing tests it, and the branch drags in an unrelated regression.
Good: Add a test that reads the JSON back and asserts the trailing newline byte, and rebase onto AI-assisted review, no game files, no GPU. |
ed3a861 to
6293c91
Compare
|
Rebased onto main, removing the two stacked commits (#4636's rpf9dump change and #4660's crosslane_fuzz change). This PR now contains only the BUILD-1348 fix: one .write(\n) after json.dump() in ools/ps_oracle.py.
Previous reviewers (kapitche, tupacfan04, Kam471): the scope issues you flagged are resolved. |
|
Re-checked at
AI-assisted review, no game files, no GPU. |
|
Tested c92301a merged with main 98fa503 on WSL2 Ubuntu (Python 3.12.16) and Windows 11 (Python 3.13.1): pass. Re-check of my earlier fail on ed3a861: resolved.
|
|
Verified on Linux: both commits apply on current main (which lacks the newline), and tests/test_ps_oracle passes 21 with the new trailing-newline test — which fails without the fix commit and passes with it, so the assertion has teeth. The write stays inside the newline-pinned open. CPU-only throughout (harness and assembler mocked). No CI checks were scheduled on this branch. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
BUILD-1348:
ps_oracle.py --jsonmissing trailing newlineProblem
tools/ps_oracle.py --jsonwrites the report withjson.dump()but does not add a trailing newline. Text files should end with\nper convention.Fix
Add
f.write("\n")afterjson.dump()in the--jsonoutput block.Tests
python -m compileall -q tools/ps_oracle.py→ no syntax errorspython -I tests/test_ps_oracle.py→ 20 tests OK (1 skipped — no GPU)Environment
AI assistance
This PR was AI-assisted. The fix was implemented with guidance from an AI agent.
Depends on: none