WIP: fix(profiling): reject incomplete or unusable chain captures #682
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!682
Loading…
Reference in a new issue
No description provided.
Delete branch "NitnekLeBorgne/Longshot-contributions:fix/chain-capture-input-20261115"
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?
Type: fix · Risk: low · Tested on: Linux, Python 3.12.3, game-free synthetic captures · Needs: full game-free suite; Windows Python check
Why
An incomplete HOS_CHAIN recording can currently be accepted as if its declared records were complete. A recording with only one present instead prints partial statistics and then raises ZeroDivisionError. Both make the profiling tool harder to trust when a recording is too short or incomplete.
Open work and issues were searched. Nearby HOS_CHAIN users and the broad file-security change were checked by their actual changed-file lists; this change does not alter the runtime recorder or those changes.
How to reproduce
Seen on: Linux, Python 3.12.3; no GPU or game required.
Settings and switches: none.
Steps: Write a synthetic HOSCHAIN1 file declaring two 32-byte records, but truncate the second record; call scripts/chain.py's load(). Separately run main() on a valid recording containing just one PRESENT. The new tests construct these inputs without game data.
Expected: a clear diagnostic before producing a frame analysis.
Actual: main at
fad1a964cdsilently accepts the shortened declared payload; the one-PRESENT case reaches a division by zero.What changed
Validate the declared payload length and diagnose incomplete or malformed known header fields. Refuse analysis when the selected presenting thread has fewer than two presents.
Measurements
Verdict: the demonstrated parser/short-capture defects fail on the named main baseline and pass on the reviewed candidate. This is a Python tool with synthetic tests, not a performance change; no FPS or hardware performance claim applies.
Flags and settings
None
Testing
Tested:
Not tested: historical local export/containment limits and missing OS namespace isolation were recorded; these are not proof that a supported full-runner qualification is impossible. The full tests/run_all.py suite, Windows, real captures, or optional samples/prof integration. Host and renderer builds were not run; no host or renderer code changes.
Must be tested:
fad1a964cd, with source/mode identity and unoccupied new test path checked historically but no rebase claimed, expecting current-main provenance and the relevant checks to be revalidated before ready; no rebase or force-push is authorized (by hand: an equipped contributor/tester inspects diagnostics and the stated outcomes before merge; not executed by this documentation edit).Risks
What could break: callers relying on silently incomplete recordings now receive SystemExit. Unknown headers and extra bytes after the declared record boundary retain their previous behavior. This is not general hardening against arbitrarily huge or hostile files.
Turning it off: revert this commit.
Compatibility: no saves, options, caches, Vulkan ABI, runtime recorder layout or Builder behavior changes. Public code and self-authored synthetic fixtures only.
Checklist
Everyone
type(scope): description) of the status line's type.main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened.Readiness provenance and checklist notes
Current main in the frozen public readback is
aa95d35f3d021b27328b6d68109666a46c340aee; this PR head is1a2f4e2372e801610c8ffd744fe8c39d93e097db. The current-main box is unchecked: historical publication/base checks are not proof of current ancestry. Current-main updating and revalidation are needed before ready, but rebase/force-push/merge are not authorized; no such operation is promised or performed. The full runner box remains unchecked; no full-suite run or Windows/host qualification is claimed by this description edit. The normal project pr ready remains blocked and must not be forced. Manual pre-merge plans are future work, not completed evidence.Historical checklist explanations (not current-main qualification):
main. Reviewed base is pinned above; upstream advanced. Kept WIP, no rebase claimed.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). Only the explicit source-read partition and targeted checks ran; full suite remains required.tests/that reads changed source updated in this PR, not weakened. New tests added; the existing path check remains byte-identical.1a2f4e2372898fbcb634Rebased onto
main@bbe6fdf: no conflicts. No tests were run here; the test boxes stay yours.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.