Skip to content

fix(PkgBuilder): size the PlayGo chunk hash entry to a fixed point - #30

Open
skippdot wants to merge 1 commit into
OpenOrbis:masterfrom
skippdot:pr/playgo-chunk-sha-size
Open

skippdot wants to merge 1 commit into
OpenOrbis:masterfrom
skippdot:pr/playgo-chunk-sha-size

Conversation

@skippdot

@skippdot skippdot commented Oct 6, 2026

Copy link
Copy Markdown

Fixes #26 (also reported as maxton#88, maxton#64, maxton#56).

BuildPkg pre-allocates the PlayGo chunk hash entry (4 bytes per 64 KiB of the final package) from a one-shot estimate. The estimate misses two things:

  • the entry itself (and the Metas entry, laid out as Entries.Count * 32) can push the body over the next 0x80000 boundary;
  • that boundary adds more chunks.

For some package sizes this throws Playgo Chunk hash file was not allocated enough space.

Fix: compute the size to a fixed point, mirroring the actual layout. The exact size is still set later, as before.

Test: ChunkShaTests.ChunkShaAllocation_HoldsForAnyPfsSize sweeps ~28k PFS sizes from 1 to 70 GB through BuildPkg without writing anything. Master fails for several sizes; it passes with the fix. Marked Slow (~75 s).

The one-shot estimate ignored that the entry itself (and the Metas entry, laid out as Entries.Count*32) can push the body across the next 0x80000 boundary, throwing 'Playgo Chunk hash file was not allocated enough space' for some multi-GB packages (OpenOrbis#26, maxton#88/maxton#64/maxton#56). Sweep test over 1-70 GB.
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.

System.Exception: Playgo Chunk hash file was not allocated enough space. Report this as a bug

1 participant