bd9b873fcd
Adds differential harnesses for random/scheduled ticks and redstone circuits on top of the block update oracle, and makes the oracle report pending block events as the deduplicated set vanilla keeps. The harness found that detector rails never sensed anything, so they now check for minecarts on place, tick and entity contact, and the client reports the player and minecarts to pressure plates, tripwires and detector rails each tick. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
34 lines
1.1 KiB
Python
Executable File
34 lines
1.1 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""Compare vanilla random ticks (and scheduled ticks) with horizon-world, state by state.
|
|
|
|
Every block state is put at the origin of a random neighbourhood and `randomTick`
|
|
(or `tick`) is run with a seeded RNG on both sides; the resulting block changes,
|
|
scheduled ticks, side effects and the RNG fingerprint after the call must match.
|
|
"""
|
|
import random
|
|
try:
|
|
from . import block_update_harness as h
|
|
except ImportError:
|
|
import block_update_harness as h
|
|
|
|
|
|
def cases(facts, count, seed, only):
|
|
rng = random.Random(seed)
|
|
pool = h.state_pool(facts, only)
|
|
for n in range(count):
|
|
state = pool[n % len(pool)]
|
|
case = {**h.environment(rng), 'pos': [0, 0, 0], 'cells': facts.cells(rng, state),
|
|
'mode': 'random' if n % 4 else 'tick'}
|
|
yield case
|
|
|
|
|
|
def main():
|
|
args = h.argument_parser(__doc__).parse_args()
|
|
facts = h.load_facts()
|
|
differing = h.execute('random-tick-parity', list(cases(facts, args.count, args.seed, args.only)), args, facts)
|
|
h.finish(differing)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|