Map 3D: key the map-cell cache by the bake #395

Manually merged
github merged 2 commits from gh-pr/395/head into gh-pr/395/base 2026-11-26 20:33:02 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-26 18:51 UTC · original
holdmysocks:six-map3d-cellbake → master · +79 −9 · 3 files · 2 commits · merged 2026-11-26 19:18 UTC

After a re-bake, the 3D map kept drawing map cells merged from the old placements. Far geometry was wrong or stale, and some areas showed floating, streaky sheets (seen at the rs pose after a rebake).

  • The cause. Built cells are cached in <work>/gui_cache_v4/cells, and the folder was keyed by the cell format and the detail settings only. Nothing in the key identified the bake, so cells from before a re-bake were read back against the new one.
  • The cache is now keyed by the bake. It carries a fingerprint of entities.bin and strings.json. After a re-bake, cells are built again.
  • Old bakes' cells are deleted. Cell folders of other bakes are removed on a background thread the first time the map is shown, and their size comes off the 4 GB cache total.
  • One-time rebuild. The cell format goes from v10 to v11, so existing caches, which may be stale already, rebuild once.
  • README updated.

Verified on the second PC before this change: with the stale cache moved aside, the freshly built cells draw correctly and the sheets are gone. Read back from disk, the fresh cells draw the same.

**@⁠holdmysocks** on GitHub · 2026-11-26 18:51 UTC · [original](https://github.com/holdmysocks/SixNG/pull/395) `holdmysocks:six-map3d-cellbake` → `master` · +79 −9 · 3 files · 2 commits · merged 2026-11-26 19:18 UTC After a re-bake, the 3D map kept drawing map cells merged from the old placements. Far geometry was wrong or stale, and some areas showed floating, streaky sheets (seen at the rs pose after a rebake). - **The cause.** Built cells are cached in `<work>/gui_cache_v4/cells`, and the folder was keyed by the cell format and the detail settings only. Nothing in the key identified the bake, so cells from before a re-bake were read back against the new one. - **The cache is now keyed by the bake.** It carries a fingerprint of `entities.bin` and `strings.json`. After a re-bake, cells are built again. - **Old bakes' cells are deleted.** Cell folders of other bakes are removed on a background thread the first time the map is shown, and their size comes off the 4 GB cache total. - **One-time rebuild.** The cell format goes from v10 to v11, so existing caches, which may be stale already, rebuild once. - README updated. Verified on the second PC before this change: with the stale cache moved aside, the freshly built cells draw correctly and the sheets are gone. Read back from disk, the fresh cells draw the same.
Cells on disk were keyed by format and detail settings only, so after a
re-bake the viewer kept reading cells merged from the old placements: wrong
far geometry and floating sheets. The cache directory now carries a
fingerprint of the bake's entities.bin and strings.json, other bakes' cell
directories are deleted on first use, and the cell format is bumped so
existing caches rebuild once.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:32:59 +00:00
github manually merged commit e1380dd1dc into gh-pr/395/base 2026-11-26 20:33:02 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.