Skip to content

Coarser windows, a crust that stays up, and getBlocks in the right order - #17

Merged
jdeast merged 1 commit into
mainfrom
hadley-contiguous-and-fixes
Sep 8, 2026
Merged

jdeast merged 1 commit into
mainfrom
hadley-contiguous-and-fixes

Conversation

@jdeast

@jdeast jdeast commented Sep 8, 2026

Copy link
Copy Markdown
Owner

--stride averages n×n source pixels into one block, so a window can cover ground it could not afford at full resolution — Hadley Rille and the Apollo 15 landing site now fit in one contiguous 2.96 × 1.48 km map at 4 m/block. --rows makes the window a rectangle.

Four bugs, all of which produced something that looked fine:

  • Nodata masked after averaging. One -3.4e38 pixel in a 2×2 block gave -8.5e37 — no longer equal to the nodata value, so every later test for it failed, and it built as a hole 10³⁵ times deeper than the crater.
  • Flat crust. Thickness has to cover the drop to the lowest neighbour, which is per-column: max(1, drop) costs 274k blocks where a flat 5 cost 1.37M, and closes 671 columns of holes the flat one left open on the rille walls, where the deepest drop is 81 blocks.
  • Falling blocks in a floating crust. The Moon's top three soil layers were concrete powder, Mars's top two red sand. Blocks go in with physics off (deliberately — running physics for half a million placements is what got the server watchdog-killed), so a floating crust never learns it is unsupported. Break one block and the landscape drains away. It did.
  • LM legs stepped in x and z at once, so consecutive iron bars touched only at an edge. Bars join by their four faces, so the legs rendered as loose rods.

Plus a client bug: getBlocks reshaped the reply into slabs of xSize*ySize. The server sends Y outermost, then X, then Z — RaspberryJuice's order since 2014 (b16a04a), so the wire format stays — making a slab xSize*zSize. Only correct when the box is as tall as it is deep, which is why it survived: every value returned was a real block from somewhere in the box.

236 tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kq1Cjkh3bVT1WLzh5FRVQG

--stride averages n x n source pixels into one block, so a window can cover
ground it could not afford at full resolution: Hadley Rille and the Apollo 15
landing site now fit in one contiguous 2.96 x 1.48 km map at 4 m per block.
--rows makes the window a rectangle, since the interesting axis is often only
one of them.

Four bugs, all of which produced something that looked fine:

  * Nodata was masked AFTER averaging, so one -3.4e38 pixel in a 2x2 block
    gave -8.5e37 -- no longer equal to the nodata value, so every later test
    for it failed, and it built as a hole 1e35 times deeper than the crater.

  * The crust was a flat thickness. It needs to cover the drop to the lowest
    neighbour, which is a per-column quantity: max(1, drop) costs 274k blocks
    where a flat 5 cost 1.37M, and closes 671 columns of holes that the flat
    one left open on the rille walls, where the deepest drop is 81 blocks.

  * The Moon's top three soil layers were concrete powder and Mars's top two
    were red sand. Blocks are placed with physics off -- deliberately, since
    running physics for half a million placements is what got the server
    killed by the watchdog -- so a floating crust never learns it is
    unsupported. Break one block and the update spreads and the landscape
    drains away. It did. A crust now uses only blocks that stay put.

  * The Lunar Module's legs stepped in x and z at once, so consecutive iron
    bars touched only at an edge. Bars decide what to join by looking at their
    four faces, so the legs rendered as loose rods hanging in the air.

And in the client, getBlocks reshaped the reply into slabs of xSize * ySize.
The server sends Y outermost, then X, then Z -- RaspberryJuice's order since
2014, so the wire format stays as it is -- which makes a slab xSize * zSize.
Only correct when the box is as tall as it is deep, which is why it survived:
every value returned was a real block from somewhere in the box.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kq1Cjkh3bVT1WLzh5FRVQG
@jdeast
jdeast merged commit a964734 into main Sep 8, 2026
10 checks passed
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