OLD-7698: restore old upstream PR 7698 - docs/world_census: rejected count, what a rejected candidate is, census_exact, --jobs default (ASSET-379) #774

Manually merged
github merged 2 commits from gh-pr/774/head into gh-pr/774/base 2026-11-26 09:20:47 +00:00
Owner

@⁠aslan2142 on GitHub · 2026-11-24 13:40 UTC · original
aslan2142:docs-sweep-world_census → main · +10 −5 · 1 files · 2 commits · merged 2026-11-24 16:38 UTC

Claimed in the coordination issue as: OLD-7698 #14

Restoration of my original pull request, old upstream PR 7698 in ItsNotRexed/Leonida, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Rebased onto main at 3bb46d658b; the two commits apply unchanged and all four corrections still hold against the current tool (its only change since, a resume-cache type check, does not touch these lines). The old PR number in the second commit's title is now plain text.

What and why

docs/world_census.md disagreed with tools/world_census.py in four places:

  • Rejected count. Coverage said "906 rejected candidates", but the Result table in the same doc (docs/world_census.md:21) says 840. That is the count re-measured after the warm-up fix, which was updated in the table only. Coverage now says 840.
  • What a rejected candidate is. A candidate is rejected when assemble raises zlib.error, struct.error or IndexError, or returns None because the stream does not end inside the archive (tools/world_census.py:395-402, None at :258-259).
    • A stream whose inflated bytes 0x10..0x15 are not 0DRPz (:185) is accepted as payload.
    • A 0DRPz stream that is truncated, does not parse or is still short of a page counts as incomplete (:305-306, :421-423).
    • invalid is a second parse check behind that (:424-426).
    • Neither is counted as rejected. The doc used to describe all of these as "rejected".
  • census_exact. The condition checks maps_exact == maps (tools/world_census.py:766), not entities_exact == entities separately. That one follows from it, because entities_exact sums the exact rows (:749-750).
  • --jobs default. The default is half the logical CPUs, capped at 12 (tools/world_census.py:801). The doc left out the cap.

Tested

  • python -I tests/test_docs_*.py (all 12): pass.
  • python -I tests/test_world_census.py: pass.
  • git diff --check: clean.
  • python -I scripts/check_no_game_data.py docs/world_census.md: clean.

Docs only; no game files needed.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-24 13:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/774) `aslan2142:docs-sweep-world_census` → `main` · +10 −5 · 1 files · 2 commits · merged 2026-11-24 16:38 UTC Claimed in the coordination issue as: OLD-7698 https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14 Restoration of my original pull request, old upstream PR 7698 in `ItsNotRexed/Leonida`, which was closed unmerged when that repository went private on 2026-11-23 (old numbers link nowhere now). Rebased onto main at 3bb46d658b0c1c81a79091f6de933fba08d1af8a; the two commits apply unchanged and all four corrections still hold against the current tool (its only change since, a resume-cache type check, does not touch these lines). The old PR number in the second commit's title is now plain text. ### What and why `docs/world_census.md` disagreed with `tools/world_census.py` in four places: - **Rejected count.** Coverage said "906 rejected candidates", but the Result table in the same doc (`docs/world_census.md:21`) says 840. That is the count re-measured after the warm-up fix, which was updated in the table only. Coverage now says 840. - **What a rejected candidate is.** A candidate is rejected when `assemble` raises `zlib.error`, `struct.error` or `IndexError`, or returns `None` because the stream does not end inside the archive (`tools/world_census.py:395-402`, `None` at `:258-259`). - A stream whose inflated bytes 0x10..0x15 are not `0DRPz` (`:185`) is accepted as payload. - A `0DRPz` stream that is truncated, does not parse or is still short of a page counts as `incomplete` (`:305-306`, `:421-423`). - `invalid` is a second parse check behind that (`:424-426`). - Neither is counted as rejected. The doc used to describe all of these as "rejected". - **`census_exact`.** The condition checks `maps_exact == maps` (`tools/world_census.py:766`), not `entities_exact == entities` separately. That one follows from it, because `entities_exact` sums the exact rows (`:749-750`). - **`--jobs` default.** The default is half the logical CPUs, capped at 12 (`tools/world_census.py:801`). The doc left out the cap. ### Tested - `python -I tests/test_docs_*.py` (all 12): pass. - `python -I tests/test_world_census.py`: pass. - `git diff --check`: clean. - `python -I scripts/check_no_game_data.py docs/world_census.md`: clean. Docs only; no game files needed. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) AI-assisted (Claude Code, Claude Opus 5.5).
- Coverage said "906 rejected candidates"; the Result table above it says
  840, the count ef54dfbf9 re-measured after the warm-up fix and left in
  the table only.
- A rejected candidate is a 16-byte-aligned zlib header that does not
  inflate to a stream ending inside the archive (scan_shard, assemble);
  an inflated stream that is not a complete or valid 0x7a resource is
  counted as incomplete or invalid, not rejected.
- census_exact (_summarize) tests maps_exact == maps, which implies
  entities_exact == entities; it does not test the latter on its own.
- The default --jobs is half the logical CPUs, capped at 12.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The rejection handler catches zlib.error, struct.error and IndexError
  (scan_shard), not only a zlib error.
- Only a stream whose inflated bytes 0x10..0x15 are 0DRPz is a 0x7a
  candidate (inflate); a stream without that prefix is accepted as
  payload. A 0DRPz stream that is truncated, does not parse or is still
  short of a page is incomplete (assemble's "complete"); invalid is a
  second parse check behind it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:20:44 +00:00
github manually merged commit a8fc8a50b3 into gh-pr/774/base 2026-11-26 09:20:47 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.