read the save's chunk blocks, and check the rock below the surface

A chunk's solid blocks are a palette of block ids, raw or zstd, and a
zstd frame of bit planes; a layer of a lone 0 is all air. With them,
vsmv verify compares the rock of every stored block below the surface
with the strata laid against our own heights, which predate the dry
seabed raise: 99.91% of 1.38 billion blocks match. Lava basalt near the
bottom, the granite of cave walls and structures, and columns whose
height differs explain all but 0.0011%, nearly all of that in one area
at the explored edge whose layer boundaries are not explained yet.

What the save has instead of stratum rock is tallied too, as the
ground truth the deposits phase can be checked against.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-10 11:59:26 +03:00
parent 53950a465c
commit 2c16f8caef
6 changed files with 335 additions and 17 deletions

View File

@@ -292,6 +292,25 @@ What the save turned out to be:
| 7 | =WorldGenTerrainHeightMap= |
| 13 | =TopRockIdMap= (block ids) |
- *=chunk=*: one 32 x 32 x 32 chunk per row, keyed by
=x | z << 27 | y << 54= in chunks. All of this save's chunks are
from 1.22.7 (field 12).
| Field | Contents |
|-------+----------|
| 1 | solid blocks, see below |
| 8 | block entities |
| 9 | mod data, e.g. ="flowVectors"= |
| 12 | game version that generated it |
The block layer is an int32 n, then the palette of block ids: raw in
-n bytes if n is negative, zstd-compressed in n bytes if not. Then
one zstd frame of bit planes, 4096 bytes each, plane k holding bit k
of every block's palette index, block =(y * 32 + z) * 32 + x= at bit
i % 8 of byte i / 8. A layer that is just n = 0 holds no blocks: all
air. 53,855 of the 114,140 chunks are like that. Water is not in this
layer; fields 2 and 3 are the likely fluid and light layers, not read
yet.
- *Assets.* The six worldgen JSONs (and all 910 asset JSONs) parse
after a relaxing pass: comments, unquoted keys and trailing commas.
There are 48 landforms, 6 provinces and 16 strata.
@@ -469,9 +488,8 @@ Validation:
- *Result.* 11,675,804 / 11,675,818 columns match, 99.9999%. The 14
others likely carry structures placed later. A further 12,118
columns have no rock on top.
- *Deeper layers* go through the same code but aren't checked against
chunk blocks. Decoding those blobs is the remaining step, if it is
ever needed.
- *Deeper layers.* Checked against the chunk blocks since; see
"Chunk blocks".
Viewer:
- *Rock layer.* Modes: surface, depth below the surface, or absolute
@@ -654,7 +672,41 @@ Viewer:
- Go-to-coordinates, PNG export of the current view.
- Later: gravel-beach layer; deposits, see below.
** Next: deposits (planned, after the Sex fixes)
** Chunk blocks (done)
=save/chunk-blocks= decodes a stored chunk's solid blocks (format under
the =chunk= table above), with zstd from the system.
=vsmv verify= now compares the rock of every stored block from y = 1
up to the lower of our height and the stored one. The strata are laid
against our height, since the game laid them before the dry seabed
raise changed the stored height. Laying them against the stored height
put a whole raised area (around z 7440-7900) one stratum off.
Result: 1,375,064,177 of 1,376,283,630 stratum rock blocks match
(99.9114%). The rest:
- 26,042 in columns whose height differs from ours;
- 1,075,584 basalt at y 18 or below: deep cave lava (y 11 and below)
turns the rock around it to basalt;
- 103,165 granite, the default rock, in pockets with air,
=stalagsection-granite=, =sand-granite= and =cobblestone-granite=.
Cave walls and underground structures write it after the strata.
Some of it later turned to =ore-quartz-granite=, so it predates the
deposits.
- 14,662 others (0.0011%), nearly all in one area near the explored
edge (x 1024100-1024700, z 7340-7630). There the layer boundaries sit
a few blocks off ours: peridotite, slate and sandstone, all ordinary
strata. Not explained yet. The province map cache is keyed so that
regions can't collide (=regionMapSize= is 8000 here), so that isn't
it. The check passes under 0.01% unexplained.
Where the save has no stratum rock (247 million blocks), it tallies what
is there instead: crackedrock 123 million, ore 66 million, soil 20
million, air 18 million, glacier ice 9 million, gravel, sand,
saltpeter, and 373 thousand other rock (halite, marble, obsidian,
travertine). That is what the deposits, caves and block layers wrote,
and what the deposits phase can be checked against.
** Next: deposits (planned)
Placing the deposits themselves, not just the pick's reading of them.
Soil deposits come first: they sit at the surface, so they don't need
the 3D rock column, and the steps up to the disc are the first half of
@@ -688,15 +740,16 @@ showing them means placing them.
gravel. Fertility and grass cover come from =GenBlockLayers= and
=blocklayers.json=, which are not ported. Without them, patches show
where the game puts them on sand, gravel or rich soil.
- *Checking.* The save stores surface blocks only in chunk blobs, which
aren't decoded yet. Until they are, walk to a few patches in game.
- *Checking.* Against the chunk blocks: clay, peat and compost soil
where the save has them, at the top of the column.
*Exact ore deposits.* The same replay, then the disc, sea-level,
anywhere and child generators placing into the strata column. That
places real ore blocks and makes the pick readings exact: the pick's
column holds the ore of its own chunk's deposits. It also reads silver
and gold (children of quartz) and peridot (a child of olivine), whose
host is their parent's ore. Checking needs the chunk blocks decoded.
host is their parent's ore. Checking: against the save's ore blocks,
which the strata check already counts (66 million).
* Risks