fix(profiling): chain.py loads a HOS_CHAIN recording with an unnamed thread #2352
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
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
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2352
Loading…
Reference in a new issue
No description provided.
Delete branch "NeoLoger/Longshot:fix/chain-unnamed-thread"
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?
Summary
scripts/perf.py chaincould not read a HOS_CHAIN recording from a Steam Deck at all: it stopped withchain.bin: invalid HOS_CHAIN header.host/hos_chain.cwrites onethread <n> <name>line per thread, and a guestthread the game never named comes out as
thread <n>(thread 89 of 96 in that recording).load()inscripts/profiling/chain.pythen indexes a third word that isn't there. Such a thread is now calledthread-<n>and the recording loads.
To see it on main: any recording with an unnamed thread, or the new check in
tests/test_chain.py.Read first:
load()inscripts/profiling/chain.py, thencheck_unnamed_thread()intests/test_chain.py.The writer is left as it is, so recordings that already exist load too. Naming such threads in
hos_chain.cinstead(like its
host-%d) would be a game-side change, and it would not fix old files.Testing
Tested: Linux (Ubuntu 26.04, Python 3.14.4), inside a no-network bubblewrap sandbox:
python -I -B tests/test_chain.py: passes on this branch; with main'schain.pyand this test it fails withinvalid HOS_CHAIN header.9dd41326, whosewriter and reader are the same as main's): on main
invalid HOS_CHAIN header; here96 threads; thread 89 = thread-89; 2097152 records.mise run test).Still to test:
Measurements
Nothing to measure: a profiling script and its test.
Risks
None for players: only
scripts/perf.py chainreads this. A thread namedthread-<n>in its output was unnamed inthe recording. Revert is enough.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.Assisted-by:/Co-Authored-By:trailers.NeoLoger referenced this pull request2026-11-23 09:03:21 +00:00
5352dea468ca40376e05StebanPi referenced this pull request2026-11-24 17:17:07 +00:00