Skip to content

Raise the default CHK chunks per tag limit to the total chunk limit - #8

Open
2Pacalypse- wants to merge 1 commit into
mainfrom
chk-chunks-per-tag
Open

2Pacalypse- wants to merge 1 commit into
mainfrom
chk-chunks-per-tag

Conversation

@2Pacalypse-

Copy link
Copy Markdown
Member

ShieldBattery's full prod map scan found one released map, Tribe Control 1.4 (256x256 UMS), that the default limits reject: its CHK pads 16,396 chunks (1 KB in total) under an all-zero tag, one over the 16 Ki per-tag default (observed: 16385, limit: 16384). The old bw-chk parser accepted it.

Every retained chunk already counts toward max_chk_chunks (64 Ki), so raising the per-tag default to match keeps memory bounded the same way. Unknown-tag chunks stay retained because Chk::chunks() exposes them.

Checked: the map parses with the change and fails without it; a unit test covers 16,396 empty chunks of one tag under the defaults. cargo test, clippy and fmt pass.

Tribe Control 1.4, a released map, pads its CHK with 16,396 mostly empty chunks under an all-zero tag and was rejected one chunk over the 16 Ki default. Every retained chunk already counts toward max_chk_chunks, so matching that limit keeps memory bounded the same way.
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.

1 participant