github markus-wa/demoinfocs-golang v6.0.0-rc.2

pre-releaseone hour ago

Go Get

go get -u github.com/markus-wa/demoinfocs-golang/v6/pkg/demoinfocs@v6.0.0-rc.2

To upgrade from v5, this may be useful to update import paths (use at your own risk):

sed -i 's/demoinfocs-golang\/v5/demoinfocs-golang\/v6/' **/*.go

Coming from v5? Read the v6.0.0-rc.0 release notes. They list every change since v5.2.0 and include a migration table. This release only adds the changes below.

Demos recorded since the CS2 update of 2026-11-11 can't be parsed with rc.1 or earlier. This release fixes that.

Fixes

  • Fix parsing of demos recorded since the CS2 update of 2026-11-11 by @pablosanches in #764 and @markus-wa in #765 (#763)
    • The update added uint8 fields with the fixed8 encoder to CCSPlayerController (m_recentKillQueue, m_nFirstKill, m_nKillCount). They were read as varints, so any value >= 128 consumed an extra byte and desynced the rest of the packet. Parsing failed with ErrDecodeFailed (nextByte: insufficient buffer, variable collection size ... out of range). On v5 the process ran out of memory instead
    • Fields with a fixed8/fixed16/fixed32 encoder are now read as N raw bits
    • Their values keep the Go type that the base type's varint decoder returns (int32 sign-extended, uint64 or uint32), so getters like Player.RankType() and PropertyValue.Int()/UInt32() work the same as before the update
    • Demos recorded before the update have no fixedN fields, so their output doesn't change
    • Backports: v5 in #767. The v4 csda branch, which cs-demo-analyzer uses, has the fix since decf1a6, and cs-demo-analyzer v1.14.1 includes it

Performance

  • A held *sendtables.Property reads its value without hashing by @billfreeman44 in #762
    • Property keeps the field path it resolved and re-resolves only after the entity's polymorphic types change (type switch or PVS re-entry). Before, each Value() call looked the name up in a map
    • Reading a held *Property: ~9 → ~2 ns. Reading by name with Entity.PropertyValue(name): ~16 → ~10 ns. No API change
    • Value() now writes the resolved path on its first read. If you read the same Property from several goroutines after parsing, synchronize those reads yourself
  • UserCmdParsingFull reconstructs user commands with generated typed code instead of protobuf reflection by @billfreeman44 in #761
    • The baseline copy and the delta merge no longer clone and walk the protobuf messages reflectively. s2_usercmd_typed.go, generated from the msg types by internal/usercmdgen (and regenerated with the protos by the "Update Protobufs" workflow), does it with typed code. No public API change, go.mod untouched
    • Decoding one delta command (copy + merge): ~2,540–2,669 → ~1,197–1,416 ns/op, 69 → 26 allocs. The merge alone: ~1,286–1,329 → ~183–190 ns/op, 0 allocs
    • csgo-rushb (every channel, UserCmdParsingFull): 12.63 → 10.33 s (−18%) on a 212 MB demo, 30.70 → 21.71 s (−29%) on 431 MB, 1.94 → 1.59 s (−18%) on 31 MB
    • Together with the Property change above, the sum of each demo's fastest of 3 parses over 10 production demos (30–412 MB) went from 140.8 to 99.5 s (−29%), with byte-identical output

Changes

  • Internal, no API change: sendtables field-path resolution was tidied up in #766. #770 adds a test that fails when the usercmd generator would silently drop a wire field, documents the accepted protobuf subset, and reports a generator gap as an issue instead of a silent red X

New Contributors

Full Changelog: v6.0.0-rc.1...v6.0.0-rc.2

Discussions / Chat / Announcements

Discord Chat

Don't miss a new demoinfocs-golang release

NewReleases is sending notifications on new releases.