chunk_generation: compare scheduled ticks; HORIZON_ORDER decoration order
Both dumps list each proto chunk's scheduled block and fluid ticks in scheduling order (`t block|fluid NAME X Y Z PRIORITY`) and the harness compares them: they run once the chunk is live, and the leaf ticks of updateShapeAtEdge were missing without any block differing at FEATURES. HORIZON_ORDER names a file of `x z` lines both sides decorate in, instead of row-major: decoration is order dependent (a chunk's features write into its neighbours), and vanilla's chunk system decorates around a player in its own order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -88,13 +88,15 @@ def parse(path):
|
||||
if line.startswith('chunk '):
|
||||
_, x, z = line.split()
|
||||
current = (int(x), int(z))
|
||||
chunks[current] = {'q': {}, 'y': {}, 'be': {}}
|
||||
chunks[current] = {'q': {}, 'y': {}, 'be': {}, 't': []}
|
||||
elif line.startswith('q '):
|
||||
_, q, row = line.split(' ', 2)
|
||||
chunks[current]['q'][int(q)] = row
|
||||
elif line.startswith('y '):
|
||||
_, y, row = line.split(' ', 2)
|
||||
chunks[current]['y'][int(y)] = row
|
||||
elif line.startswith('t '):
|
||||
chunks[current]['t'].append(line[2:])
|
||||
elif line.startswith('be '):
|
||||
head, *forms = line.split('\t')
|
||||
parts = head.split(' ')
|
||||
@@ -228,6 +230,12 @@ def compare(vanilla, rust, names, label, limit=6, quiet=False):
|
||||
for key in sorted(set(a['be']) | set(b['be'])):
|
||||
if not entity_matches(a['be'].get(key), b['be'].get(key)):
|
||||
entity_diffs.append((key, a['be'].get(key, [None])[0], (b['be'].get(key) or [None])[0]))
|
||||
# Scheduled ticks run once the chunk is live (leaves at a tree's edge, lake fluids).
|
||||
if a.get('t', []) != b.get('t', []):
|
||||
ta, tb = a.get('t', []), b.get('t', [])
|
||||
first = next((i for i, (u, v) in enumerate(zip(ta, tb)) if u != v), min(len(ta), len(tb)))
|
||||
block_diffs.append((pos[0] * 16, 0, pos[1] * 16, f'{len(ta)} ticks, #{first}: {ta[first] if first < len(ta) else "-"}',
|
||||
f'{len(tb)} ticks, #{first}: {tb[first] if first < len(tb) else "-"}'))
|
||||
if block_diffs or biome_diffs or entity_diffs:
|
||||
chunks += 1
|
||||
blocks += len(block_diffs)
|
||||
|
||||
Reference in New Issue
Block a user