@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# A Horizon CI runner (labels self-hosted, Linux, X64, horizon-game and the host's name) on a Linux machine of the
|
||||
# maintainer's (NixOS: ludodesktop, ludothinkpad; Ubuntu: playhorizon, a partner's server), as a systemd user service
|
||||
# maintainer's (NixOS: ludodesktop; Ubuntu: playhorizon, a partner's server), as a systemd user service
|
||||
# of the account that holds his Minecraft files, like the Mac mini's runners (docs/release-flow.md). Run it on that
|
||||
# machine, as that user:
|
||||
#
|
||||
|
||||
@@ -241,6 +241,12 @@ def world_blocks():
|
||||
cmd('/clone 0 205 0 4 207 4 6 205 6 masked'),
|
||||
cmd('/execute if blocks 0 205 0 4 207 4 6 205 6 all'),
|
||||
cmd('/setblock 3 206 3 minecraft:air'),
|
||||
# A container keeps its loot table and seed until its items change
|
||||
# (RandomizableContainer.tryLoadLootTable / trySaveLootTable).
|
||||
cmd('/setblock 7 206 7 minecraft:chest{LootTable:"minecraft:chests/simple_dungeon",LootTableSeed:42L}'),
|
||||
cmd('/data get block 7 206 7'),
|
||||
cmd('/data get block 7 206 7 LootTableSeed'),
|
||||
cmd('/setblock 7 206 7 minecraft:air'),
|
||||
# A hopper placed into power turns `enabled=false` and keeps its block entity.
|
||||
cmd('/setblock 5 205 5 minecraft:redstone_block'),
|
||||
cmd('/setblock 5 206 5 minecraft:hopper'),
|
||||
|
||||
@@ -7245,5 +7245,58 @@ CHECKS += ['cushions']
|
||||
CHECK_FNS['cushions'] = check_cushions
|
||||
|
||||
|
||||
def check_forced_levels(host, guest, out):
|
||||
"""#1525: forced block/entity ticks outlive the last player and the 300-tick idle timeout.
|
||||
|
||||
Also keep a resident, unforced furnace outside the forced ticket's neighbour ring: scheduling
|
||||
a playerless integrated-server level must not enable the fixtures' tick-everywhere fallback.
|
||||
"""
|
||||
if not SERVER_THREAD:
|
||||
return 'skipped (needs --server-thread)'
|
||||
start = pos_of(guest)
|
||||
results = {}
|
||||
guest('command', command='gamemode creative')
|
||||
try:
|
||||
for dimension in (NETHER, END):
|
||||
into_level(guest, dimension, 8, 100, 8)
|
||||
host('command', command='tick freeze')
|
||||
furnace = ('minecraft:furnace{Items:[{Slot:0b,id:"minecraft:raw_iron",count:1},'
|
||||
'{Slot:1b,id:"minecraft:coal",count:1}],cooking_total_time:200,'
|
||||
'cooking_time_spent:0}')
|
||||
for x in (8, 56):
|
||||
guest('command', command=f'setblock {x} 100 8 {furnace}')
|
||||
server_reply(guest, f'execute if data block {x} 100 8 '
|
||||
'Items[{Slot:0b,id:"minecraft:raw_iron"}] '
|
||||
'run say forced-input-ready', 'forced-input-ready')
|
||||
guest('command', command='forceload add 8 8')
|
||||
guest('command', command='summon minecraft:armor_stand 8.5 104 8.5 {Tags:["forced_tick"]}')
|
||||
guest('command', command=f'execute in {OVERWORLD} run tp @s {start[0]} {start[1]} {start[2]}')
|
||||
wait_dimension(guest, OVERWORLD, 400)
|
||||
host('command', command='tick step 450')
|
||||
host.wait(500)
|
||||
prefix = f'execute in {dimension} '
|
||||
results[dimension] = server_reply(
|
||||
host, prefix + 'if data block 8 100 8 Items[{Slot:2b,id:"minecraft:iron_ingot"}] '
|
||||
'if data block 56 100 8 {cooking_time_spent:0} '
|
||||
'if data block 56 100 8 Items[{Slot:0b,id:"minecraft:raw_iron"}] '
|
||||
'if data entity @e[tag=forced_tick,limit=1] {Pos:[8.5d,101.0d,8.5d]} run say forced-level-pass',
|
||||
'forced-level-pass')
|
||||
assert dims(host, guest) == (OVERWORLD, OVERWORLD), dims(host, guest)
|
||||
host('command', command=prefix + 'run forceload remove 8 8')
|
||||
host('command', command=prefix + 'run kill @e[tag=forced_tick]')
|
||||
host('command', command='tick unfreeze')
|
||||
finally:
|
||||
host('command', command='tick unfreeze')
|
||||
for dimension in (NETHER, END):
|
||||
host('command', command=f'execute in {dimension} run forceload remove 8 8')
|
||||
guest('command', command=f'execute in {OVERWORLD} run tp @s {start[0]} {start[1]} {start[2]}')
|
||||
guest('command', command='gamemode survival')
|
||||
return results
|
||||
|
||||
|
||||
CHECKS += ['forced-levels']
|
||||
CHECK_FNS['forced-levels'] = check_forced_levels
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
+5
-12
@@ -28,19 +28,12 @@
|
||||
"python": "python3.13",
|
||||
"jobs": 6,
|
||||
"nice": 10,
|
||||
"note": "a partner's server (Ubuntu, 8 EPYC threads, 30 GB, Detroit; tailnet only), used by nothing else: 6 jobs, in the CI runner's environment, slice and Xvfb screen (tools/ci/linux-runner.sh); the light Linux checks that used to go to the ThinkPad go here"
|
||||
},
|
||||
"thinkpad": {
|
||||
"ssh": "thinkpad",
|
||||
"root": "code/horizon-parity",
|
||||
"shell": "sh -c",
|
||||
"jobs": 2,
|
||||
"nice": 19,
|
||||
"environment": {
|
||||
"PARITY_BUILD_JOBS": "2"
|
||||
"exclude": {
|
||||
"mob_ai": "the vanilla oracle runs out of its 3 GB heap here (OutOfMemoryError in IO workers; passes on the desktop and the Mac) - 2026-10-26 trial",
|
||||
"lan_integration": "two clients rendered on the CPU (lavapipe): different timing subtests fail on each run (elytra, consume-release, barter, critical-hits) - 2026-10-26 trial",
|
||||
"world_reopen": "failed twice here (no Save and Quit button after reopening; the minecart-count flake), passes on the desktop - 2026-10-26 trial"
|
||||
},
|
||||
"note": "hosts the Claude account pool: two harnesses at most, at the lowest priority",
|
||||
"setup": "export PKG_CONFIG_PATH=$HOME/code/horizon-parity/alsa-dev/lib/pkgconfig"
|
||||
"note": "a partner's server (Ubuntu, 8 EPYC threads, 30 GB, Detroit; tailnet only), used by nothing else: 6 jobs, in the CI runner's environment, slice and Xvfb screen (tools/ci/linux-runner.sh); the always-on Linux host since the ThinkPad stopped running harnesses (2026-10-26)"
|
||||
}
|
||||
},
|
||||
"local_only": {
|
||||
|
||||
+2
-4
@@ -46,12 +46,10 @@ from tools import parity, release_train # noqa: E402
|
||||
|
||||
RBUILD = Path.home() / "fleet" / "rbuild"
|
||||
LINE_LIMIT = 500
|
||||
# What rbuild's login shell needs on each fleet machine before cargo (it adds sccache itself). The ThinkPad hosts
|
||||
# the Claude account pool: three jobs at most.
|
||||
# What rbuild's login shell needs on each fleet machine before cargo (it adds sccache itself). The ThinkPad no
|
||||
# longer builds (2026-10-26: it keeps the AI pool and a few services; Linux work goes to playhorizon's runner).
|
||||
HOST_SETUP = {
|
||||
"macmini": "source ~/.cargo/env; export PATH=/opt/homebrew/bin:$PATH CARGO_BUILD_JOBS=${CARGO_BUILD_JOBS:-10}",
|
||||
"thinkpad": 'export CARGO_BUILD_JOBS=3 PKG_CONFIG_PATH="$(ls -d /nix/store/*-alsa-lib-*-dev/lib/pkgconfig | tail -1):'
|
||||
'$(ls -d /nix/store/*-systemd-*-dev/lib/pkgconfig | tail -1)"',
|
||||
"local": "",
|
||||
}
|
||||
# Hosts that hold the vanilla data, and how a run there gets it: CI's own runner scripts on the parity runner's
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Check #1527: per-dimension /forceload add/remove across normal restarts.
|
||||
|
||||
Build horizon-client and horizon-ctl with the fast profile first, then run:
|
||||
python3 tools/singleplayer_forced_chunks_audit.py --case force-save
|
||||
Runs both default server-thread and in-frame singleplayer, using scratch homes.
|
||||
"""
|
||||
import argparse
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
from agent_control_e2e import Cli
|
||||
import lab
|
||||
|
||||
|
||||
DIMENSIONS = ('the_nether', 'the_end', 'overworld')
|
||||
|
||||
|
||||
def query(cli, dimension, expected):
|
||||
since = cli('events')['last']
|
||||
cli('command', command='forceload query')
|
||||
deadline = time.monotonic() + 15
|
||||
while time.monotonic() < deadline:
|
||||
reply = cli('events', since=since)
|
||||
for event in reply['events']:
|
||||
text = event.get('text', '')
|
||||
if event.get('event') != 'chat' or f'minecraft:{dimension}' not in text:
|
||||
continue
|
||||
if expected:
|
||||
if all(f'[{x}, {z}]' in text for x, z in expected):
|
||||
return
|
||||
elif 'No force loaded chunks' in text:
|
||||
return
|
||||
time.sleep(0.1)
|
||||
raise AssertionError(f'{dimension}: expected {expected}, got {reply}')
|
||||
|
||||
|
||||
def run(bin_dir, resources, in_frame):
|
||||
with tempfile.TemporaryDirectory(prefix='hz-force-save-') as scratch:
|
||||
work = Path(scratch)
|
||||
previous = None
|
||||
for stage in range(3):
|
||||
# Every process gets fresh homes; copy only this fixture's saved world.
|
||||
env = lab.game_env({k: v for k, v in os.environ.items() if k not in (
|
||||
'HORIZON_HOME', 'HORIZON_LAUNCHER_HOME', 'XDG_DATA_HOME', 'XDG_CONFIG_HOME')})
|
||||
home = Path(env['HORIZON_HOME'])
|
||||
if previous is not None:
|
||||
shutil.copytree(previous, home / 'saves')
|
||||
socket = work / f'{stage}.sock'
|
||||
cli = Cli(bin_dir / 'horizon-ctl', socket, home, env)
|
||||
args = [str(bin_dir / 'horizon-client'), '--resources', str(resources),
|
||||
'--world', 'forced', '--creative', '--seed', '4242', '--offscreen',
|
||||
'--render-distance', '4', '--control', '--control-socket', str(socket)]
|
||||
if in_frame:
|
||||
args.append('--in-frame')
|
||||
with (work / f'{stage}.log').open('w') as log:
|
||||
process = subprocess.Popen(args, cwd=home, env=env, stdout=log, stderr=log)
|
||||
try:
|
||||
deadline = time.monotonic() + 120
|
||||
while not socket.exists():
|
||||
if process.poll() is not None or time.monotonic() > deadline:
|
||||
raise RuntimeError('game did not open its control socket')
|
||||
time.sleep(0.1)
|
||||
cli('wait_ready', seconds=240)
|
||||
for i, dim in enumerate(DIMENSIONS):
|
||||
cli('command', command=f'execute in minecraft:{dim} run tp @s 0 100 0')
|
||||
for _ in range(30):
|
||||
cli('wait', ticks=20)
|
||||
if cli('state').get('dimension') == f'minecraft:{dim}':
|
||||
break
|
||||
else:
|
||||
raise AssertionError(f'did not enter {dim}')
|
||||
cli('wait_ready', seconds=240)
|
||||
expected = [(i - 1, -1)] if stage == 1 else []
|
||||
query(cli, dim, expected)
|
||||
if stage == 0:
|
||||
cli('command', command=f'forceload add {(i - 1) * 16} -1')
|
||||
query(cli, dim, [(i - 1, -1)])
|
||||
elif stage == 1:
|
||||
cli('command', command=f'forceload remove {(i - 1) * 16} -1')
|
||||
query(cli, dim, [])
|
||||
cli('quit')
|
||||
assert process.wait(timeout=120) == 0
|
||||
except Exception:
|
||||
log.flush()
|
||||
print((work / f'{stage}.log').read_text(errors='replace')[-6000:])
|
||||
raise
|
||||
finally:
|
||||
if process.poll() is None:
|
||||
process.terminate()
|
||||
process.wait(timeout=30)
|
||||
previous = home / 'saves'
|
||||
print(f'PASS force-save: {"in-frame" if in_frame else "server-thread"}, three dimensions, add/remove/restart')
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--case', choices=['force-save'], default='force-save')
|
||||
parser.add_argument('--bin-dir', type=Path, default=Path(__file__).resolve().parents[1] / 'target/fast')
|
||||
args = parser.parse_args()
|
||||
for in_frame in (False, True):
|
||||
run(args.bin_dir.resolve(), lab.RESOURCES.resolve(), in_frame)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compare the real Squid.aiStep client branch and cycle event with Rust."""
|
||||
import json
|
||||
import random
|
||||
|
||||
try:
|
||||
from . import lab, oracle_harness as harness
|
||||
except ImportError:
|
||||
import lab, oracle_harness as harness
|
||||
|
||||
|
||||
def make_input(build):
|
||||
rng = random.Random(1684)
|
||||
rows = []
|
||||
for species in ('squid', 'glow_squid'):
|
||||
for water in (False, True):
|
||||
for reset in (False, True):
|
||||
for velocity in ((0, 0, 0), (.1, 0, 0), (0, .1, 0),
|
||||
(0, -.1, 0), (0, 0, -.1), (.1, .2, -.3)):
|
||||
for movement in (0, 1, 2.4, 3.14, 4, 6.2, 6.4):
|
||||
rows.append(dict(species=species, water=water, reset=reset,
|
||||
x=velocity[0], y=velocity[1], z=velocity[2],
|
||||
body=rng.uniform(-180, 180),
|
||||
v=[movement, .2, -45, 33, .15, .8]))
|
||||
for _ in range(1000):
|
||||
rows.append(dict(species=rng.choice(('squid', 'glow_squid')), water=True,
|
||||
reset=False, x=rng.uniform(.01, .2), y=rng.uniform(.01, .2),
|
||||
z=rng.uniform(.01, .2), body=rng.uniform(-180, 180),
|
||||
v=[rng.uniform(0, 7), 0, rng.uniform(-90, 90),
|
||||
rng.uniform(0, 180), rng.uniform(.1, .2), rng.random()]))
|
||||
path = build / 'inputs.jsonl'
|
||||
path.write_text(''.join(json.dumps(row) + '\n' for row in rows))
|
||||
return path, len(rows)
|
||||
|
||||
|
||||
def main():
|
||||
harness.differential(
|
||||
'rust-squid-client-parity', 'VanillaSquidClientOracle', 'squid_client_probe',
|
||||
make_input,
|
||||
'Actual Squid.aiStep on a client with controlled inherited movement/world services. '
|
||||
'Checks water/air body rotation and tentacle state, cycle clamping and event 19. '
|
||||
'Glow squid uses the same inherited method; packet dispatch and rendering are separate.',
|
||||
sources=[lab.ROOT / 'crates/horizon-client/src/mobs/aquatic.rs'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user