Merge remote-tracking branch 'origin/main' into pr/796
# Conflicts: # crates/horizon-core/src/density/tests.rs
This commit is contained in:
+21
-3
@@ -4,7 +4,7 @@
|
||||
|
||||
In the Horizon menu style, the Options screen's **Video** section holds the graphics settings, with a Simple / Advanced switch at the top (remembered between sessions):
|
||||
|
||||
- **Simple**: a preset (Performance, Balanced, Quality, Ultra or Custom), render distance, FOV, max framerate, VSync and GUI scale.
|
||||
- **Simple**: a preset (Performance, Balanced, Quality, Ultra or Custom), render distance, LOD distance, FOV, max framerate, VSync and GUI scale.
|
||||
- **Advanced**: every setting, grouped under Rendering, Quality, Display, Preferences, Performance and Overlay.
|
||||
|
||||
In the Classic style, Video Settings starts with two buttons opening the same settings as vanilla-looking screens.
|
||||
@@ -17,7 +17,7 @@ Every row has a one-line description and its cost in frame time (none, low, medi
|
||||
| Group | Setting | Stored in |
|
||||
| --- | --- | --- |
|
||||
| Rendering | render distance, simulation distance, entity distance | `options.txt` (vanilla keys) |
|
||||
| | cave culling, chunk updates per frame | `horizon-graphics.txt` |
|
||||
| | LOD distance, cave culling, chunk updates per frame | `horizon-graphics.txt` |
|
||||
| Quality | smooth lighting, mipmap levels, biome blend, clouds, cloud distance, weather radius, particles, entity shadows, cutout leaves | `options.txt` |
|
||||
| | sky, fog, weather, animated textures | `horizon-graphics.txt` |
|
||||
| Display | FOV, max framerate, VSync, fullscreen, GUI scale | `options.txt` |
|
||||
@@ -31,7 +31,25 @@ Every row has a one-line description and its cost in frame time (none, low, medi
|
||||
|
||||
Which settings each level shows, their descriptions and costs are in `crates/horizon-client/src/graphics_ui.rs` (`rows`); the Horizon shell draws them in `options_horizon.rs` with `ui_theme::described_row`, and the Classic screens use `graphics_style.rs`.
|
||||
|
||||
Not implemented: distant-terrain LOD, anisotropic filtering (wgpu needs linear magnification for it, which blurs close blocks), MSAA (FXAA instead) and exclusive fullscreen (fullscreen is borderless).
|
||||
## Distant terrain
|
||||
|
||||
**LOD Distance** is off by default. Enable it in Simple or Advanced graphics settings and choose 64, 128, 256, 512 or 1024 chunks. With LODs enabled, **Full Detail Distance** controls the nearby normal chunks; LOD Distance controls the outer view. Keep the nearby range modest, for example 12 chunks with a 256-chunk LOD distance. Increasing the distant range does not increase simulation distance.
|
||||
|
||||
Distant terrain uses progressively coarser voxel columns. Columns retain separate material layers and air gaps; matching exposed faces are merged, with block-scale texture repeats. Complete chunk data is reduced once on the terrain worker and cached at each supported scale, across each cell’s area instead of enlarging its corner column. Material votes combine different light levels of the same block; reduced cells retain the brightest sampled sky and block light separately. Finer tiles replace only their own footprints in a loading fallback, and a movement margin limits rapid resolution changes at tile boundaries. Local Overworld, Nether and End worlds and a LAN world you host can supply their generator. Remote servers do not supply the client's world-generation seed or generator configuration.
|
||||
|
||||
Unknown areas are sampled directly from the dimension's seed-bound density and surface rules, with shared per-tile scratch and material evaluation. A small pool samples tiles independently of meshing. Refinement prioritizes visible screen error; high aerial views use the distance to the world height range to avoid unnecessary close detail below the camera. Initial vegetation uses the world's configured tree types, placement densities and biome assignments at every distance level. Tree positions, shapes and large-cell coverage are visual approximations, not a replay of native feature placement.
|
||||
|
||||
A separate bounded worker refines the nearest LOD levels with disposable ordinary chunk generation, including supported carvers, structures and decoration. Groups of 4×4 chunks share their generation halos, and each chunk is published once every neighbouring feature center has completed. Farther tiles use direct sampling rather than waiting for every intervening ordinary chunk. Saved and visited blocks take precedence over both paths. These temporary chunks never enter gameplay, simulation or normal save queues. Generated-column caches and request queues are bounded; far data is regenerated after reopening a world.
|
||||
|
||||
Coverage and detail improve progressively; a large selected radius does not mean all its target detail is already resident. The control status reports target and sampled target tile counts separately. Direct far sampling approximates vertical noise interpolation, fluid boundaries and lighting; surface slopes and column extensions, small features and partial block shapes can differ. Unexplored distant structures are not synthesized by the direct path, and native decoration order can differ from subsequent gameplay generation. Horizon-supported data-driven noise and tree configurations can be reused; this does not execute arbitrary Fabric/NeoForge worldgen or structure mods.
|
||||
|
||||
Ordinary Overworld atmospheric fog extends with the selected LOD distance. Fog Off disables distance haze at large ranges too; fluid, darkness and boss fog retain their limits.
|
||||
|
||||
LOD terrain enters the existing world colour and depth passes, so supported shader-pack postprocessing can see it. This does not add Iris material passes or shadow maps: Java packs still have the [existing fullscreen-pass limitations](shader-packs.md). Shader appearance and transitions need testing with the selected pack.
|
||||
|
||||
The setting is stored as `lodDistance` in `horizon-graphics.txt`; `0` disables it. Existing `renderDistance` in `options.txt` keeps its normal meaning for full chunks.
|
||||
|
||||
Not implemented: anisotropic filtering (wgpu needs linear magnification for it, which blurs close blocks), MSAA (FXAA instead) and exclusive fullscreen (fullscreen is borderless).
|
||||
|
||||
## Benchmark
|
||||
|
||||
|
||||
+8
-4
@@ -20,10 +20,14 @@ plan are in [docs/server.md](https://github.com/ludovic111/horizon/blob/main/doc
|
||||
Until then Horizon players can join offline servers only (`online_mode = false`). An offline server never
|
||||
checks accounts: anyone who reaches it can join under any name. Keep it on your LAN or a tailnet
|
||||
(Tailscale, ZeroTier), or share it only with friends you trust.
|
||||
- **No secure chat.** Chat isn't signed, and `enforce-secure-profile` has no effect. Vanilla clients show
|
||||
chat from the server as not secure.
|
||||
- **Nether and End:** the world follows a player through portals when they are alone on the server
|
||||
(v2026.10.17.09 and newer). With several players online, portals don't move remote players yet.
|
||||
- **Secure chat** works as on vanilla's server: in online mode, vanilla clients sign their chat, and with
|
||||
`enforce-secure-profile=true` (the default) unsigned chat is refused. On an offline server, or for a player
|
||||
without a chat session (Horizon's own client today), chat stays unsigned and shows as not secure.
|
||||
- **Nether and End:** each player travels on their own through portals, and operators with `execute in
|
||||
<dimension> run tp`. The players in the level they leave stop seeing them, and the ones in the level they
|
||||
arrive in start to, as on vanilla (checked against vanilla with two players, by command and through an End
|
||||
portal: `tools/test_server_dimension_players_parity.py`). The console can't send another player to a
|
||||
dimension yet (`execute in ... run tp NAME`).
|
||||
- **Movement checks and chunk pacing** (release v2026.10.17.16 and newer). The server pulls back players who
|
||||
move too fast ("moved too quickly"), as vanilla does, and sends chunks as fast as each client acknowledges
|
||||
them.
|
||||
|
||||
+218
-14
@@ -236,7 +236,15 @@ How the game loads them, without touching vanilla's path:
|
||||
so the same mod set gives the same ids. Saves store block names, so ids never reach the disk.
|
||||
- Loaders that read only `data/minecraft/` (recipes, loot, tags) read every namespace, as
|
||||
vanilla does. With no mods there is only `minecraft`, so nothing changes.
|
||||
- The overlay is cached like the resource-pack overlay and rebuilt when a mod file changes.
|
||||
- The overlay is built on the first start with a set of mods and kept for later starts. A stamp
|
||||
(`horizon-mod-content.stamp`) hashes the game executable, the base tables and every mod file's
|
||||
size and mtime. Adding, removing or editing a mod, or a new build of Horizon, rebuilds it. For
|
||||
ATM10's 40 data-tier mods the build takes about a minute of the first start on a busy machine.
|
||||
- **Worldgen.** Mods' structures, structure sets, template pools, processor lists, configured and
|
||||
placed features join the `worldgen/*.json` bundles. Their structure templates go under
|
||||
`worldgen/structure/<ns>/`. Their biome tags are merged into `worldgen/biome_tags.json`, minus
|
||||
the biomes and tags Horizon does not have. Mod biomes, noise and density functions are not
|
||||
carried yet.
|
||||
- **Limits.** Chunk sections size their global palette to the registry: 16 bits for vanilla's
|
||||
35,723 states (the same chunks, saves and packets as before), one more bit each time content
|
||||
mods double it, up to 2^20 states (1,048,576). Past that the content root is refused with the
|
||||
@@ -398,6 +406,162 @@ Mechanical, the same for every mod, and no agent:
|
||||
carries those over.
|
||||
5. Write `<id>.hmod`. For a data-tier mod, it is now ported.
|
||||
|
||||
Two cases the oracle fills in:
|
||||
|
||||
- **Loot registered in code.** Chipped ships 7 loot tables for about 7,000 blocks; the rest
|
||||
drop themselves through Java code. When a declared block has no table in the jar and the
|
||||
oracle shows vanilla's drop-self, carry writes that table in 26.3's shape. When only the
|
||||
states with one property value drop it (a door's lower half), the entry gets vanilla's
|
||||
`match_block` condition. Chipped: 6,843 tables added.
|
||||
- **Worldgen carry-over.** Structure libraries give vanilla's types other names. Carry maps
|
||||
these to vanilla's:
|
||||
- `lithostitched:jigsaw`, MoogsStructureLib's and Repurposed Structures' generic jigsaws
|
||||
become `minecraft:jigsaw`;
|
||||
- their `advanced_random_spread` becomes `minecraft:random_spread`;
|
||||
- their versioned, legacy and empty pool elements become vanilla's.
|
||||
|
||||
Three more rewrites make the mapped structures decode and start where their mod would:
|
||||
- **Block states.** 1.21.1 writes a block or fluid state as `{"Name", "Properties"}`, 26.3
|
||||
as `{"id", "properties"}` and refuses the old shape, which failed the whole processor
|
||||
list, feature or pool. Carry rewrites them (#816; 1,005 files in 17 of ATM10's mods).
|
||||
- **Start and placement rules** (#820 in the game, #821 in carry). Repurposed Structures'
|
||||
and Moog's jigsaws refuse to start in liquid and check biomes and terrain height in a
|
||||
radius; their spreads keep a minimum distance from the world origin and away from other
|
||||
sets (named by a structure set tag). Carry writes these under `horizon:start_checks`,
|
||||
`horizon:min_distance_from_world_origin` and `horizon:exclusion_zone`; the game runs them
|
||||
(`horizon-world`'s `structure/start_checks.rs`). Vanilla data has none of the keys. Moog's
|
||||
also spreads its structures 1.65 times as far apart as its files say, which carry now
|
||||
applies. MVS went from 829 starts to 90 in a 128×128-chunk square (seed 1234): 294 from the
|
||||
spacing, the rest from the start checks.
|
||||
- **Processors written in Java** are taken out of their lists (#822). The game, like
|
||||
vanilla, refuses a list holding a type it does not know, and with it every pool naming the
|
||||
list. The structures now generate undecorated (no pillars under them, spawners as the
|
||||
template has them); 1,427 processors of 146 types in ATM10's mods, the most common
|
||||
`lithostitched:block_swap`, Formations' `biome_replacements` and Repurposed Structures'
|
||||
pillar, fluid and void processors.
|
||||
- **Spawner processors** carried as data (`horizon-port-pack/src/processors.rs`). Most
|
||||
chests in the mods' templates already name their loot table; what the Java processors add
|
||||
is the spawners' mobs. Moog's and Repurposed Structures' spawner randomizing processors
|
||||
become `horizon:spawner_mobs` (a weighted mob per spawner, picked with the placement's
|
||||
random as theirs do, and the spawner NBT they write; Repurposed's `rs_spawners` lists are
|
||||
written in). YUNG's Better Dungeons and Better Desert Temples turn a spawner or a
|
||||
placeholder block (gravel, bone block, yellow wool...) into a spawner of a fixed mob: that
|
||||
is vanilla's `rule` processor with an `append_static` block entity. Moog's vanilla loot
|
||||
swap acts only when a "replace vanilla" preset is on, and they ship off. Moog's trial
|
||||
spawner and vault processors keep the block and change its block entity: one `rule` per
|
||||
block state, with the game's `horizon:edit` modifier, which takes out the state the
|
||||
template was saved with (a vault saved with `state_updating_resumes_at` far in the future
|
||||
never opens; a spawner's saved `spawn_data` blocks its own mobs) and merges in the
|
||||
spawner's normal and ominous configs (by id: the carry upgrades `trial_spawner/` files'
|
||||
mobs to 26.3's `equipment`) or the vault's loot table and key. Better Desert Temples'
|
||||
placeholder blocks (orange, red and white glass, blue and yellow concrete, red wool,
|
||||
polished diorite, blank pots) become what its processors make of them: the fixed swaps as
|
||||
vanilla's `rule`, the random ones (suspicious sand, sand and sandstone, upside-down stairs,
|
||||
cobwebs, sherds on the pots) as the game's `horizon:pick`, on the same `nextFloat` as the
|
||||
mod. Better Dungeons' small dungeons keep one chest and each other one with a fifth's
|
||||
chance, two at most (the game's `horizon:count_cap`, counted per placement as the mod's
|
||||
DungeonContext is): 12 chests in five small dungeons at seed 1234 become 6.
|
||||
Lithostitched's `block_swap` (137 lists, all in ChoiceTheorem's Overhauled Village) is the
|
||||
game's `horizon:block_swap`: the same map, with Block.withPropertiesOf's properties kept;
|
||||
a target block the game does not have (most of them are Nature's Spirit's and Croptopia's)
|
||||
leaves the block as it is, as the mod does. Lithostitched's `reference` (CTOV builds most
|
||||
of its lists from others) has the referenced lists' processors written in its place; its
|
||||
`apply_random`, `condition` and `set_block` are the game's `horizon:apply_random`,
|
||||
`horizon:condition` and `horizon:set_block`, with Lithostitched's random (the world seed
|
||||
plus the name's hash, at the block, piece or structure). In a CTOV plains village at seed
|
||||
1234 the farms now grow carrots, potatoes and beetroot besides wheat, and 1,655
|
||||
cobblestone blocks become paths, grass, mossy cobblestone and planks. No Lithostitched processor is
|
||||
dropped now (130 before), only CTOV's compat hooks for other mods inside them (142 copies).
|
||||
Still taken out: Formations' biome replacements, Repurposed's pillars and fluid fixes,
|
||||
blocks aged or propped up.
|
||||
In the 128×128-chunk square (seed 1234), every spawner of a mod structure now has its mob:
|
||||
in the Overworld 83 Better Dungeons spawners held the template's placeholder pig and 17 of
|
||||
Moog's were empty (763 spawners with a mob, up from 628); in the Nether the 52 empty ones
|
||||
in Moog's Nether Structures are filled (162, up from 110). Chests are unchanged: 2,777
|
||||
and 1,405 with a loot table.
|
||||
- **Rule tests** written in Java. Repurposed Structures' mineshafts and Nether monument test
|
||||
blocks with three of the mod's own rule tests inside vanilla `rule` processors: what a
|
||||
block is made of (solid, liquid, air, with rails and chains), a chance over the distance
|
||||
from the template's origin along one axis, and a world height range. The game runs them
|
||||
as `horizon:matter_phase`, `horizon:piece_origin_axis_aligned_linear_pos` and
|
||||
`horizon:y_value` with the mod's fields, and carry renames them (213 in 75 lists).
|
||||
- **Renamed ids.** 26.3 calls 1.21.1's chain the iron chain (its datafixers rename it in
|
||||
worlds). Carry renames it in recipes, loot tables and worldgen files (112 files in 5 mods:
|
||||
Repurposed's mineshafts, Better Dungeons' processors, Regions Unexplored's hanging sign
|
||||
recipes...), which otherwise fail to load in 26.3. With both, the 5 Nether mineshaft pools load: 47 of
|
||||
Repurposed's Nether mineshafts in the 128×128-chunk square (seed 1234), under the lava sea.
|
||||
- **Big templates** (#838). Vanilla reads structure templates with no limit on their tag
|
||||
count; Horizon now does too (`nbt::Limits::templates`). Seven of ATM10's 8,962 carried
|
||||
templates are past the old 1,000,000-tag cap: YUNG's monument start, four When Dungeons
|
||||
Arise main pieces and two Nullscape pieces. They used to load as empty templates, so their
|
||||
structures never started.
|
||||
- **Additions to other sets and pools** (#832 in the game, #833 in carry). A set or pool file
|
||||
holding `horizon:add_to` appends its entries to the sets or pools it names (docs/mods.md).
|
||||
Carry writes these from lithostitched's `add_structure_set_entries` and
|
||||
`add_template_pool_elements` modifiers whose load conditions hold for the mods ported
|
||||
along, and from CTOV's Java registration: its 21 village types and 11 outposts join
|
||||
vanilla's `villages` and `pillager_outposts` with the mod's default weights.
|
||||
- **YUNG's API** (#839, #846 in the game; #840, #847 in carry). `yungsapi:yung_jigsaw` and its
|
||||
elements become vanilla's jigsaw and single element, with their rules under
|
||||
`horizon:yungsapi`. The game assembles them as YUNG's `JigsawManager` does: priority
|
||||
pieces, caps by name, depth ranges, `ignore_bounds` and the conditions tree. YUNG's
|
||||
placements become `horizon:` keys on a random spread: `horizon:exclusion_zone` for the
|
||||
enhanced exclusion zone, `horizon:avoid_biomes` for the temples' ocean and river search,
|
||||
`horizon:ring_sections` for Better Strongholds' rings. `horizon:disables` on a YUNG
|
||||
structure turns off the vanilla type its mod's mixin turns off. It is written only when
|
||||
the game can start the replacement, so vanilla mineshafts stay while Better Mineshafts (a
|
||||
Java type) can't.
|
||||
- **Repurposed Structures' and Moog's own assembler** (#850 in the game, #851 in carry). Both
|
||||
lay out their jigsaws with `PieceLimitedJigsawManager`, not vanilla's. Their structures, the
|
||||
Nether variants too, get `horizon:piece_limited`: `y_allowance`, burying, the pools whose
|
||||
fallbacks ignore the bounds, liquid, the Nether land search and ledge, and each
|
||||
structure's piece caps and required pieces from the mod's `*_pieces_spawn_counts` files.
|
||||
The game assembles them the mods' way and runs their post-layout steps (centring,
|
||||
burying, the Nether land search).
|
||||
|
||||
|
||||
Each mod's `carry-report.json` lists what was mapped, the rules and processors lost by name,
|
||||
and the types left as they are. NeoForge's convention biome tags (`#c:is_forest`, ...) come
|
||||
from the loader jar (`<work>/loader/neoforge-<version>-universal.jar`, fetched dev-only and
|
||||
SHA-1 checked) and are written into the carry. The game skips the structures it cannot
|
||||
decode.
|
||||
|
||||
On ATM10's 42 data-tier mods with a jar (seed 1234, chunks -64..63, `chunkgen_bench
|
||||
--starts` over the carried worldgen): 286 starts with 15,097 pieces, 150 of them vanilla's
|
||||
(unchanged), and no pool that fails to decode (65 before #816 in the 64×64 centre).
|
||||
- 1,061 files were mapped (MVS 413, MNS 210, MSS 157, MES 110, Repurposed Structures 104,
|
||||
ChoiceTheorem's Overhauled Village 66), and 103 convention biome tags written.
|
||||
- When Dungeons Arise, Structory and Towns and Towers use vanilla's types already.
|
||||
- Still lost, written in Java:
|
||||
- Formations' structure and element types (179): their placements read block states in the
|
||||
noise column (solid, water, lava), which the structure context doesn't give yet;
|
||||
- Repurposed's mineshafts, mansions and monuments, Better Mineshafts and two Better
|
||||
Dungeons types: Java structure types;
|
||||
- YUNG's and Moog's enhanced terrain adaptation, YUNG's piece modifiers and dead-end pools,
|
||||
and the block processors written in Java (YUNG's banners, legs and decorations, Repurposed's
|
||||
pillars and fluid fixes, Lithostitched's block swaps);
|
||||
- MO Structures (38; its library is only on CurseForge).
|
||||
|
||||
With every structure PR above, the same square (seed 1234, chunks -64..63) holds 362
|
||||
overworld starts with 22,026 pieces. CTOV has 7, Better Dungeons 72 and Better Ocean
|
||||
Monuments 3, and vanilla's monuments are gone as YUNG's mod has them. In the Nether there
|
||||
are 512 starts, up from 322: Moog's Nether Structures 147, Repurposed's Nether structures
|
||||
40, Better Fortresses 7, with no vanilla fortress. Over chunks -256..255: Better Strongholds 10
|
||||
(vanilla 0), Better Jungle Temples 5, Better Witch Huts 11. Vanilla's own worlds are
|
||||
unchanged: the structure-start oracle still matches 35 of 35.
|
||||
|
||||
Repurposed's Nether city, Nether shipwrecks and End stronghold are its generic jigsaw with
|
||||
one more start check each, carried as `minecraft:jigsaw` with the check named in
|
||||
`horizon:start_checks.repurposed`: open air from sea level + 20 to + 45 around the city's
|
||||
chunk, no solid block in a 33×30×33 grid over a shipwreck, and land 45 blocks up at nine
|
||||
points 35 and 70 blocks apart for the stronghold. Over chunks -320..319 in the Nether there
|
||||
are 2 cities and 45 shipwrecks (30 and 865 without the checks); the End stronghold keeps
|
||||
8,000 blocks from the centre, and chunks 500..1139 × -320..319 hold 2 (43 without).
|
||||
|
||||
In a world with the 40 mods, seed 1234, `/locate structure mvs:azelea_house` finds one 27
|
||||
blocks from spawn and it stands there as the template builds it; When Dungeons Arise's
|
||||
bandit towers and Structory's chapel locate too.
|
||||
|
||||
### 5. Code: one agent per mod
|
||||
|
||||
For tiers logic, machines and deep, in dependency order, as many agents at once as the AI
|
||||
@@ -473,12 +637,15 @@ user's jars are, and its facts and results stay in the work folder. The first re
|
||||
| Glassential-renewed 3.4.7 | 105/114 | 5177/5177 | 5177/5177 | 4727/5177 | 6447/6447 | 210/210 | 105/105 | 143/143 | 106/115 |
|
||||
| Factory Blocks 1.4.0 | 42/49 | 42/42 | 0/42 | 42/42 | 294/294 | 84/84 | 42/42 | 1/1 | 42/49 |
|
||||
| Cloud Glass 1.1.0 | 16/16 | 16/16 | 16/16 | 0/16 | 112/112 | 32/32 | – | 31/31 | 16/16 |
|
||||
| Chipped 4.0.2 | 6857/6981 | 46212/46443 | 46443/46443 | 46396/46443 | 149093/149093 | 13548/13714 | 11984/12378 | 6/13 | 6849/6973 |
|
||||
|
||||
What fails is what API 0.2 cannot express yet: shapes of their own (Japanese doors, hedges,
|
||||
paths a sixteenth high, glass without collision), sound events of the mod's own
|
||||
(`factory_blocks:metal_sound`), and blocks whose vanilla class has no vanilla block with the
|
||||
same states (garage doors, double gates, engraved and facing paths, fans). Every drop, recipe
|
||||
and tag of the declared blocks matches.
|
||||
and tag of the declared blocks matches. Chipped's 124 missing blocks are its own classes (workbenches and
|
||||
`DirectionBlock`), and its workbench recipes need those blocks. Its drops match since carry writes
|
||||
the self-drop tables it registers in code (step 4).
|
||||
|
||||
### 7. Coverage report
|
||||
|
||||
@@ -520,9 +687,9 @@ files; `inventory`; `carry` and the harness on the eight mods we downloaded; `re
|
||||
By tier, the 367 not yet: data 57 (carry-over and the harness, no agent: their jars were not
|
||||
downloaded), logic 66 (API 0.3), machines 97 (0.4), deep 92 (0.5), client 35, unclassified 20.
|
||||
Ported: Macaw's Trapdoors. Partial: Macaw's Doors, Fences and Walls, Paths and Pavings,
|
||||
Glassential, Factory Blocks, Cloud Glass (see the harness table) and MVS, whose 784 worldgen
|
||||
files are carried but not yet read by the game. Of the 8, 7 are MIT and one LGPL; nothing is
|
||||
published.
|
||||
Glassential, Factory Blocks, Cloud Glass, Chipped (see the harness table) and MVS, whose
|
||||
structures now generate (see step 4). Of the 9, 7 are MIT, one LGPL and Chipped is under the
|
||||
Terrarium License; nothing is published.
|
||||
|
||||
## Measuring "10x"
|
||||
|
||||
@@ -582,8 +749,9 @@ vanilla's 35,723; the per-state tables are the next thing to measure), while the
|
||||
inside its 2 GB heap. Caveats, so none of this is a "10x" claim yet: other sessions and CI
|
||||
runners kept the machine's load average between 30 and 56 on 14 threads, so the confidence
|
||||
intervals are as wide as the means (`perf_bench.py --table`); Horizon's frames are paced near
|
||||
the display's 144 Hz at 8 chunks; Horizon's title time includes building the content overlay on
|
||||
a first start (about 5 s, cached afterwards); and the pack runs 1.21.1 against Horizon's 26.3.
|
||||
the display's 144 Hz at 8 chunks; Horizon's title time includes building the content overlay
|
||||
(about 5 s for six mods; it was rebuilt on every start then, and is kept for later starts now);
|
||||
and the pack runs 1.21.1 against Horizon's 26.3.
|
||||
A quiet rerun with more games is the next measurement.
|
||||
|
||||
**Where the RAM goes (2026-10-17).** RSS overstates it on macOS. `ps` counts pages the allocator
|
||||
@@ -620,8 +788,46 @@ indexes ids by a hash checked against the states: -22 MB live for vanilla, -124
|
||||
ATM10's, -30 MB and -140 MB of footprint. The startup peaks are what is left. Each step parses
|
||||
its per-state tables whole: as JSON trees, or as NBT trees of 300-600 MB each for ATM10
|
||||
(`block-properties.nbt`, the collision, support, occlusion and movement tables). The peak
|
||||
reaches 3.9 GB during worldgen loading, and the footprint stays near the peak. Typed, streaming
|
||||
readers for those tables are the next cut.
|
||||
reaches 3.9 GB during worldgen loading, and the footprint stays near the peak.
|
||||
|
||||
The NBT tables now stream: the readers check each state's identity as it is read, and no
|
||||
`states` tree is built (#753). That tree was about 240 MB for each table. With the carried
|
||||
ATM10 mods (153,511 states), the peak of each step falls by about 210 MB:
|
||||
|
||||
| step | before MB | after MB |
|
||||
|---|---:|---:|
|
||||
| light | 911 | 699 |
|
||||
| collision | 945 | 733 |
|
||||
| motion | 1,427 | 1,215 |
|
||||
| worldgen, uncached | 3,000 | 2,788 |
|
||||
|
||||
The fluid tables no longer decode the 211 MB `gameplay-facts.json` a second time (#754). The
|
||||
content root is kept between starts (#756). What is left at startup:
|
||||
|
||||
- `facts.json` went through a JSON tree, then an NBT tree, in both the registry and the assets
|
||||
step. It now streams (#825): at ATM10's size (214,338 states) each step's peak fell from
|
||||
816 MB to 153 MB (registry) and 235 MB (assets), and the RSS after the assets step from
|
||||
1,344 MB to 442 MB;
|
||||
- on a first start, the content-root build and `Behaviours`' decode of `gameplay-facts.json`
|
||||
(cached afterwards in the behaviour snapshot).
|
||||
|
||||
**Against NeoForge, same 40 mods (2026-10-17).** The 40 data-tier mods carried from ATM10 (the
|
||||
42 without Regions Unexplored and MO Structures, whose libraries are only on CurseForge),
|
||||
against their jars on NeoForge 21.1.259 with `-Xmx2G`. `perf_bench.py --port-work`, RD 8, one
|
||||
game each, load average 80-125 on 14 threads; `--warm` measures a later start:
|
||||
|
||||
| game | title / world s | RSS steady / peak MB | footprint steady / peak MB |
|
||||
|---|---|---|---|
|
||||
| Horizon before #756 (every start) | 81.1 / 102.8 | 4,008 / 4,164 | 2,368 / 2,554 |
|
||||
| Horizon, first start | 105.2 / 128.8 | 3,795 / 3,993 | 2,306 / 2,560 |
|
||||
| **Horizon, later starts** | **21.6 / 33.7** | **2,629 / 2,935** | **2,445 / 2,731** |
|
||||
| NeoForge + 40 mods | 53.2 / 119.9 | 3,099 / 3,203 | 3,304 / 3,381 |
|
||||
|
||||
On later starts, Horizon uses 15 % less RSS and 26 % less footprint than NeoForge with the
|
||||
same mods. It reaches the title 2.5x sooner and the world 3.6x sooner, and its flights ran at
|
||||
93-233 FPS against NeoForge's 27-62. The first start is slower than NeoForge's to the title,
|
||||
because it builds the content root once. One game per row on a loaded machine is not a
|
||||
benchmark; a quiet rerun with repeats is still to do.
|
||||
|
||||
## The working version for 2026-10-23
|
||||
|
||||
@@ -648,11 +854,9 @@ In scope (each is a PR or a small stack):
|
||||
6. **Measured:** load time, RAM and FPS of that pack on NeoForge 1.21.1 against Horizon, with
|
||||
the full ATM10 on NeoForge as the reference row.
|
||||
|
||||
Out of scope for that date, and next in order: worldgen carry-over (the 30 or so structure and biome mods;
|
||||
the first one looked at, Moog's Voyager Structures, declares all 130 structures and 116 structure
|
||||
sets with MoogsStructureLib's own `generic_jigsaw_structure` and `advanced_random_spread` types and
|
||||
NeoForge's `c:` biome tags, so its carry needs a mapping to vanilla's jigsaw and random spread
|
||||
types plus the oracle's biome tags, not only bundle merging),
|
||||
Out of scope for that date, and next in order: the rest of worldgen carry-over (mods'
|
||||
structures, sets, pools and features generate now, see step 4; mod biomes, noise and density
|
||||
functions, and the structure types written in Java such as YUNG's and Formations', do not yet),
|
||||
behaviour callbacks and server events (0.3), block entities, menus, capabilities and net
|
||||
(0.4), the first agent-ported logic-tier mod as the pilot of step 5, then machines. Porting all
|
||||
of ATM10 is a campaign. Each step publishes its coverage number; we make no claim beyond what
|
||||
|
||||
@@ -287,6 +287,22 @@ its row. The game reads this content into its block and item tables
|
||||
nobody registers (a block a port left out, another mod's item) is dropped,
|
||||
so the rest of the tag still loads; vanilla would drop the whole tag.
|
||||
|
||||
A mod adds to structure sets and template pools that are not its own
|
||||
(vanilla's villages, another mod's houses) with a set or pool file in its own
|
||||
namespace holding `horizon:add_to`, a key vanilla data never has. Its entries
|
||||
are appended to each set or pool named, after every mod's own files, in mod
|
||||
and file order; the file is no set or pool itself. A name nobody defines is
|
||||
skipped.
|
||||
|
||||
```json
|
||||
{ "horizon:add_to": "minecraft:villages",
|
||||
"structures": [ { "structure": "mymod:village_beach", "weight": 10 } ] }
|
||||
```
|
||||
|
||||
A pool addition holds `"elements"` as a pool does. This is what lithostitched's
|
||||
`add_structure_set_entries` and `add_template_pool_elements` modifiers do on
|
||||
NeoForge and Fabric, and `horizon-port-pack carry` writes them from those.
|
||||
|
||||
## Versions and compatibility
|
||||
|
||||
- The API is the WIT package `horizon:mods@0.1.0`. New functions and
|
||||
|
||||
@@ -109,7 +109,7 @@ game accepts, test hooks included.
|
||||
- **Observe:** `state` (position, rotation, velocity, health, food, saturation,
|
||||
XP, effects, game mode, dimension, time, weather, the screen and what the
|
||||
crosshair points at), `looking-at`, `entities [RADIUS] [TYPE]` (mobs with
|
||||
ids and health, dropped items, orbs), `block X Y Z`, `blocks X1 Y1 Z1 X2 Y2 Z2`,
|
||||
ids and health, dropped items, orbs), `block X Y Z`, `blocks X1 Y1 Z1 X2 Y2 Z2`, `light X1 Y1 Z1 X2 Y2 Z2`,
|
||||
`find-block BLOCK [RADIUS]`, `inventory` (stacks with their components as
|
||||
SNBT), `screen` (the open screen or title menu, its buttons and slots) and
|
||||
`messages` (chat, title, subtitle and action bar).
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
# Paletted container access
|
||||
|
||||
The `unpack`/`get` cell reader and `BlockSection::get`/`set` are hot in the
|
||||
chunk workers: light and mesh workers unpack a section's 4,096 cells before
|
||||
propagating or meshing, and world-generation workers write one block at a time
|
||||
through `BlockSection::set`.
|
||||
|
||||
The write path resolved the old cell and probed the palette three times; the
|
||||
bulk readers dispatched the palette per cell; and the storage layer revalidated
|
||||
indices and values a section had already checked. All three are addressed.
|
||||
|
||||
## Changes
|
||||
|
||||
`BlockSection::set` (`crates/horizon-world/src/chunk.rs`) previously resolved the
|
||||
old cell through `get` and then probed the section's palette map three times for
|
||||
one non-trivial write: once to key the old state by id (`local_ids[&old]`), once
|
||||
to test the incoming state (`contains_key`), and once to find it (`get`). The
|
||||
slot at the written index already *is* the old state's id, so the old state is
|
||||
now read straight from storage, and the incoming state is resolved with a single
|
||||
map probe. The palette-reuse, free-slot and growth paths are unchanged, so the
|
||||
encoded palette, counts, free list and NBT output stay identical.
|
||||
|
||||
`BlockSection::get` and `set` validate the section index and the state id once,
|
||||
then read and write through `PackedStorage::read`/`write`
|
||||
(`crates/horizon-core/src/storage.rs`). These skip the storage-level bounds and
|
||||
value checks and the `Result` that `PackedStorage::get`/`set` keep for external
|
||||
callers: a section index is below 4,096 and a palette id always fits the width
|
||||
`bits_for_palette` chose. Both new methods `debug_assert` their contract and are
|
||||
used for the hot read, the hot write and the palette-growth re-encode.
|
||||
|
||||
`PalettedContainer::unpack` and `unpack_u16`
|
||||
(`crates/horizon-core/src/paletted.rs`) matched on the palette variant inside the
|
||||
per-cell loop. `Single`, `List` and `Global` are now dispatched once before the
|
||||
loop, leaving each arm a branch-free indexed loop.
|
||||
|
||||
No allocation, layout or wire format changes.
|
||||
|
||||
## Reproduce
|
||||
|
||||
```sh
|
||||
cargo test -p horizon-world --lib --profile fast benchmark_section_get_set -- --ignored --nocapture
|
||||
cargo test -p horizon-core --lib --profile fast benchmark_unpack -- --ignored --nocapture
|
||||
```
|
||||
|
||||
The ignored tests compare the new code against copies of the pre-optimization
|
||||
implementations, kept in the test modules (`baseline_get`/`baseline_set`,
|
||||
`baseline_unpack`). They check every resulting palette, count, free list, cell
|
||||
and NBT before timing. Rounds alternate baseline/optimized order with `black_box`
|
||||
and report the median and best nanosecond- or microsecond-per-operation; the best
|
||||
round is the estimate of uninterrupted CPU time on a contended machine.
|
||||
|
||||
`benchmark_section_get_set` uses a 32-state registry and 50,000 random writes and
|
||||
reads per round over a section whose palette grows through the 4- and 5-bit
|
||||
widths (24 distinct states); 51 rounds. `benchmark_unpack` fills a 4,096-entry
|
||||
list palette (12 states) and the global palette, 2,000 calls per round, 25
|
||||
rounds.
|
||||
|
||||
AMD Ryzen 5 5600X, Linux x86_64, rustc 1.99.0, optimized `fast` profile,
|
||||
nonincremental, no LTO:
|
||||
|
||||
| Operation | Original main | New | Speedup |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| `BlockSection::set` | 13.15 ns/write | 9.12 ns/write | 1.44x |
|
||||
| `BlockSection::get` | 2.33 ns/read | 1.45 ns/read | 1.61x |
|
||||
| `unpack`, list palette | 1.910 us/call | 1.834 us/call | 1.04x |
|
||||
| `unpack`, global palette | 2.270 us/call | 2.179 us/call | 1.04x |
|
||||
|
||||
The distinct-state differential test
|
||||
`chunk::tests::set_matches_baseline_under_random_edits` drives the optimized
|
||||
`set` and `get` and the originals over the same 50,000-edit streams for 1, 2, 16,
|
||||
17, 24 and 64 distinct states, including periodic whole-section collapses that
|
||||
clear the storage and reclaim palette slots, and asserts equal results, bits,
|
||||
palette, counts, free list, `local_ids` and NBT throughout.
|
||||
@@ -0,0 +1,39 @@
|
||||
# Progressive world resources (#712)
|
||||
|
||||
Stage 3a changes shared resource storage and accessors. Pack resources keep their existing per-game ownership for pack reloads. Stage 3b publishes core before the simulation tail, builds the real renderer using the previous device after releasing its surface, and gates backdrop streaming on that renderer. Stage 3c queues an early Play or Connect action and draws the existing level-loading progress screen while polling the worker each event-loop turn. Close and resize events continue to work. After the worker completes, the queued local/server action resumes; integrated servers receive the resource handle only after that join. The synchronous harness and dedicated path returns only fully loaded resources.
|
||||
|
||||
Startup logs distinguish `core-ready`, `world renderer ready`, `starting title backdrop`, and `rest-ready`. Opt-in performance summaries carry `to_core_ms` and `to_rest_ms` separately from the existing UI-driven `to_title_ms`. Loader failures and panics propagate to the client; a tail taking more than 120 seconds fails rather than waiting indefinitely.
|
||||
|
||||
## Stage 3d: interactive menu before core
|
||||
|
||||
An ordinary launch now owns a `StartupMenu` inside `Loading`. The first menu atlas and panorama message makes the existing title screens interactive; assets, facts, biomes, pack tables, collision and motion continue on the resource worker. Pack-overlay and mod-content preparation also run on that worker. The live landscape still starts only after the core renderer exists.
|
||||
|
||||
World browsing, world creation, server address entry and options use the existing title/options widgets. Play and Connect queue a `PendingWorldEntry`; the progress screen covers both the core and tail waits. Escape cancels the queued entry in either phase. Close and resize continue to work. The handoff transfers the title object, options screen, settings, cursor, clipboard selection, timing session and pending action instead of rebuilding the user's screen.
|
||||
|
||||
Pack changes during core loading request another loader generation. The old core and tail finish before replacement begins so cache writes and tail registry initialization cannot overlap. Each generation has its own message channel and progress counter. Language/GUI metadata publication stays on the event-loop thread, using the current language selection rather than the worker's stale settings snapshot. Pack changes after the core handoff also wait for the tail before touching mob metadata.
|
||||
|
||||
The menu still needs its own artwork and renderer before interaction. The core handoff still builds the full renderer and starts audio on the main thread; menu click sounds and controller navigation start with `Game`. This stage does not change synchronous harness/dedicated startup or introduce a render-facts export.
|
||||
|
||||
Regression coverage publishes menu artwork while a fake core worker is blocked, edits a world draft, replaces fallback artwork without losing it, queues entry and draws progress, and checks that loader failure reaches the app. Additional checks cover server identity and cancelled-entry timing.
|
||||
|
||||
## Render facts assessment
|
||||
|
||||
`MeshTables::new` reads names, registry properties, class membership, collision shape flags, fluid and render properties from `BlockFacts`. `LightTables::new/load` reads emission, dampening, occlusion and shape-occlusion flags; geometry comes from `occlusion.nbt`. Neither table needs recipes, item data, AI or the other tail tables.
|
||||
|
||||
A render subset is possible, but the current facts decoder also validates registry order and builds the gameplay projection from the same document. Meshing additionally depends on class chains from `block-behaviours.json`. Avoiding the 54 MB read requires an exported render-facts artifact (and its prepare/cache/version checks), or another decoder plus a second full read at world entry. This is beyond a cheap startup ownership change. Stage 4 can add that artifact and compare the resulting mesh/light tables against the full loader before moving facts out of core.
|
||||
|
||||
## Measurement
|
||||
|
||||
Measurements on this machine are warm runs with `HORIZON_NO_AUDIO=1`. Other compilation and parity jobs were running, so elapsed times are diagnostic rather than a controlled benchmark.
|
||||
|
||||
Before phasing (3a, `42d65465`), `--offscreen --frames 3 --smoke-report` completed successfully with peak RSS 762,536 KiB. The report contained 3 frames, no chunks, no generated or meshed sections, no player, and no error. This is the synchronous harness path; the progressive path is measured separately after 3c.
|
||||
|
||||
After phasing, the same warm three-frame synchronous smoke completed successfully with peak RSS 774,080 KiB, up 11,544 KiB (1.5%) from the 3a measurement. Both reports had 3 frames, no chunks, no generated or meshed sections, no player, and no error. Elapsed time is intentionally excluded from the comparison because the machine was running concurrent builds.
|
||||
|
||||
The progressive checks used an overlay of the prepared resources with `mob-data.json` replaced by a FIFO. This holds WorldRest without a production delay hook. Core and the real renderer became ready, Options → Video opened, and the backdrop logged `title backdrop ready; world rest ready: false` before the FIFO was released. In an unblocked Horizon launch, core was ready at 4,776 ms, the renderer at 5,260 ms, and rest at 6,282 ms under compilation load. Backdrop generation and fade-in still take their own time; these marks measure bundle readiness separately.
|
||||
|
||||
A direct singleplayer launch while the FIFO was held displayed `Loading items` and handled a window resize. Releasing the FIFO resumed entry; the run exited cleanly with a player, 85 chunks, 529 meshed sections and no error. That delayed-entry run peaked at 1,142,560 KiB, including the loaded world. Integrated-server entry also joined after release and rendered a world. Dedicated startup reached `Done`, handled `list` and `stop`, saved and exited with status 0 without constructing a renderer.
|
||||
|
||||
The full parity selection against `origin/main` also includes the unmerged Stage 2 ancestors (313 harnesses). The local run was bounded at 30 minutes; its log recorded passes for `active_effects`, `active_effect_tick` and `anchor`. The remainder needs CI or a longer dedicated run. The client Rust tests, focused startup probes and memory measurements are separate from that incomplete parity run.
|
||||
|
||||
Progressive-title RSS was measured separately with audio disabled, render distance 4 and a 30 FPS cap, using separate temporary game directories. The first 30-second pair measured 1,055,132 KiB before and 1,721,772 KiB after. A warm 60-second repeat in reverse order measured 1,031,948 KiB before and 1,145,776 KiB after: an increase of 113,828 KiB (about 111 MiB, 11%). These launches ran during compilation and did not advance through startup/streaming identically. They establish a memory cost to investigate, not a claim of RSS parity; a quiet-machine cold/warm comparison remains needed before merging the stack.
|
||||
@@ -0,0 +1,81 @@
|
||||
# Nether-portal section-scan benchmark
|
||||
|
||||
Run with the pinned prepared client resources:
|
||||
|
||||
```sh
|
||||
CARGO_BUILD_JOBS=6 cargo run --profile fast -p horizon-client --example portal_scan_bench -- \
|
||||
.local/horizon-client/26.3
|
||||
```
|
||||
|
||||
The example keeps the original `Game::may_hold_portal` alongside the resident
|
||||
cache (`portal_sections`). Both run in the same optimized binary, alternating
|
||||
measurement order. Each workload has one discarded warmup pair and seven pairs
|
||||
of 300 ticks. It reports resource loading and fixture construction separately.
|
||||
This measures the section scan only, not the whole `entity_portals` span, the
|
||||
sweep that follows a positive answer, or the rest of the tick.
|
||||
|
||||
The fixture is a 17x17 chunk world (289 chunks), each with 24 sections, and 500
|
||||
entity reaches spread over it (an item or mob box 0.25 wide and the small move
|
||||
that produces the swept box). A reach touches 1-4 sections. Four palettes:
|
||||
sparse (one non-portal state), dense (128 distinct), global (300 distinct, a
|
||||
global palette whose `maybe_has` walks the whole state range) and dense_portal
|
||||
(the dense palette with a portal in every fifth section). These are controlled
|
||||
fixtures, not a claim about typical generated terrain.
|
||||
|
||||
Steady includes the initial cache fill amortized over 300 ticks. Cold recreates
|
||||
the cache each tick, including allocation and destruction; reload clears it each
|
||||
tick while retaining capacity. Edit workloads alternate a block value in three
|
||||
or all 289 chunks before every scan. Timing includes the `Arc::make_mut` move of
|
||||
the 176-byte chunk wrapper caused by weak cache handles; the baseline holds no
|
||||
such handles. Both paths keep the original outer reach list.
|
||||
|
||||
The scan is parity-checked in the same run: the cached and per-tick answers must
|
||||
agree for every reach over every sample, or the example panics.
|
||||
|
||||
Measured on an AMD Ryzen 5 5600X (12 logical CPUs), Linux x86-64, rustc 1.99.0
|
||||
(b940084d7), using `fast` (release optimization, LTO off, 16 codegen units).
|
||||
Resource loading took 705 ms; fixture construction took 66 ms sparse, 360 ms
|
||||
dense, 392 ms global and 385 ms dense_portal, shared by both implementations.
|
||||
|
||||
Median microseconds per tick (seven paired samples):
|
||||
|
||||
| Palette | Workload | Original | Cached | Speedup |
|
||||
| --- | --- | ---: | ---: | ---: |
|
||||
| sparse | steady | 40.058 | 16.836 | 2.38x |
|
||||
| sparse | cold | 40.203 | 48.619 | 0.83x |
|
||||
| sparse | reload | 40.828 | 44.552 | 0.92x |
|
||||
| sparse | edit_1pct | 41.282 | 52.200 | 0.79x |
|
||||
| sparse | edit_all | 50.119 | 4192.396 | 0.01x |
|
||||
| dense | steady | 244.610 | 21.869 | 11.19x |
|
||||
| dense | cold | 292.533 | 1505.691 | 0.19x |
|
||||
| dense | reload | 250.397 | 1301.608 | 0.19x |
|
||||
| dense | edit_1pct | 256.522 | 69.132 | 3.71x |
|
||||
| dense | edit_all | 263.829 | 5904.581 | 0.04x |
|
||||
| global | steady | 6179.070 | 360.082 | 17.16x |
|
||||
| global | edit_1pct | 6251.530 | 1565.249 | 3.99x |
|
||||
| dense_portal | steady | 256.854 | 21.078 | 12.19x |
|
||||
| dense_portal | cold | 240.498 | 1526.251 | 0.16x |
|
||||
| dense_portal | reload | 347.879 | 2037.123 | 0.17x |
|
||||
| dense_portal | edit_1pct | 368.684 | 118.108 | 3.12x |
|
||||
| dense_portal | edit_all | 282.876 | 7194.112 | 0.04x |
|
||||
|
||||
The global palette's `maybe_has` walks the whole ID range, so rescanning every
|
||||
chunk each tick (cold, reload, edit_all) is intractable; those rows are not
|
||||
measured for it.
|
||||
|
||||
Keep: the steady scan improves for every palette (2.4x to 17x), which is the
|
||||
case that repeats each tick in real play. Under constant edits the cache also
|
||||
improves the dense and global palettes (edit_1pct 3-4x) because the original
|
||||
rescans through the per-tick map. Rescanning every chunk every tick (cold,
|
||||
reload, edit_all) is slower than the original because a miss scans all 24
|
||||
sections of a chunk, where the original only touched the sections a reach
|
||||
overlaps. No whole-game speedup is inferred from this microbenchmark; real
|
||||
terrain's palette sizes and block-write frequency determine the gain. Lighting
|
||||
and other chunk changes conservatively invalidate a chunk's mask.
|
||||
|
||||
The cache adds a weak handle and mask per visited resident chunk, retains no
|
||||
unloaded block data, and is pruned when a chunk unloads (`sync_tick_chunks`) and
|
||||
cleared on resource reload, like `random_tick_sections`. Editing a cached chunk
|
||||
can move its 176-byte wrapper (plus Arc bookkeeping) on the first edit after it
|
||||
is cached; it does not force a deep copy of the block data. The original outer
|
||||
reach-list allocation remains.
|
||||
@@ -131,6 +131,7 @@ the notes.
|
||||
| Archive | Runs on | Checks |
|
||||
| --- | --- | --- |
|
||||
| `horizon-linux-x86_64.tar.gz` | GitHub `ubuntu-22.04` (an older glibc, so it runs on any recent distribution) | the standard loader and libraries only (`tools/check_imports.py`) |
|
||||
| `horizon-server-linux-x86_64.tar.gz` | the same Linux job, after the client archive: `horizon-server`, `horizon-prepare` and the game built with `--no-default-features` as `horizon-engine` (docs/server.md) | as above, and neither `libasound.so.2` nor `libudev.so.1` (`tools/check_imports.py --server`) |
|
||||
| `horizon-windows-x64.zip` | GitHub `windows-latest`, C runtime linked in | system DLLs only (`tools/check_imports.py`) |
|
||||
| `horizon-macos-arm64.zip` | The Mac mini's runner (`vars.MAC_RUNNER=macos-latest` sends it to GitHub) | system libraries only (`otool -L`); a 1500-frame offscreen run of a new world (about 12 s; 300 frames end before the world has loaded) with resources prepared from the runner's own Minecraft (`--offscreen --world smoke --frames 1500 --smoke-report`: frames drawn, chunks generated and meshed, a player, no error) |
|
||||
|
||||
|
||||
+64
-22
@@ -55,9 +55,10 @@ distance 10. The vanilla server was the pinned 26.3 `server.jar` on Java 25 with
|
||||
| What has to be installed | one 46.8 MB binary + 589 MB of prepared resources | Java 25 + the 62 MB jar |
|
||||
| Crates linked | 384 (wgpu, winit, cpal, gilrs, arboard, naga…) | n/a |
|
||||
|
||||
On Linux the binary loads `libasound.so.2` (cpal) and `libudev.so.1` (gilrs) at startup, even on a server.
|
||||
wgpu, winit and the Wayland/X11 libraries are loaded only when a window opens. That makes a minimal
|
||||
container image need ALSA and udev for a program that never plays a sound or reads a controller.
|
||||
On Linux the full game loads `libasound.so.2` (cpal) and `libudev.so.1` (gilrs) at startup. wgpu, winit
|
||||
and the Wayland/X11 libraries are loaded only when a window opens. The server build (`horizon-engine`,
|
||||
section 3) is the same program built without its `audio` and `controllers` features, so it needs neither
|
||||
library, and a minimal server image runs it as it is.
|
||||
|
||||
The two clear losses are RAM and idle CPU. The dedicated server loads everything the client needs to draw
|
||||
(the HUD atlas, item renderer, block-entity models, panorama, fog and music tables, entity models), and it
|
||||
@@ -74,15 +75,20 @@ not tick cost, so it is in scope here (see section 9).
|
||||
headless client built from vanilla's own codecs, pings and joins Horizon's server and vanilla's from the
|
||||
same world copy. It compares every login, configuration and play packet up to the first chunk batch, the
|
||||
chunk bytes, chat, `/list`, failing commands, the console lines and the files left behind. Result on main:
|
||||
see "Harnesses on main" below. The real vanilla GUI client (`tools/vanilla_client.py`) could not be run
|
||||
here: the tool only knows Linux natives, and the Mac mini's session was locked, which stalls the client's
|
||||
rendering. It runs on the desktop under vscreen.
|
||||
see "Harnesses on main" below.
|
||||
- **The real vanilla 26.3 client** (`tools/vanilla_client.py`, from the owner's own files, dev-only) joins
|
||||
too. On 2026-10-18 it joined the server build of the game (`horizon-engine`, section 3) on the Mac mini:
|
||||
`python3 tools/vanilla_client.py --name Vanilla --join localhost:PORT`. It logged in, drew the terrain
|
||||
around spawn and stayed connected for four minutes, with no warning or error on the server. The tool
|
||||
runs on Linux under vscreen and on macOS from the logged-in screen session, even a locked one, with vsync
|
||||
off.
|
||||
|
||||
### What fails or is missing
|
||||
|
||||
| Area | Status |
|
||||
|---|---|
|
||||
| `online-mode=true` | **Works** (ServerLoginPacketListenerImpl): a 1024-bit RSA key pair at start ("Generating keypair"), the encryption request, the shared secret and challenge, AES/CFB8, and the session service's `hasJoined` check (with the address when `prevent-proxy-connections` is on), with vanilla's log lines and messages. `test_online_mode_parity.py` runs the same logins against vanilla's server and Horizon's with a mock session service. Not yet: secure chat (chat is unsigned, as on a server that doesn't enforce it). |
|
||||
| `online-mode=true` | **Works** (ServerLoginPacketListenerImpl): a 1024-bit RSA key pair at start ("Generating keypair"), the encryption request, the shared secret and challenge, AES/CFB8, and the session service's `hasJoined` check (with the address when `prevent-proxy-connections` is on), with vanilla's log lines and messages. `test_online_mode_parity.py` runs the same logins against vanilla's server and Horizon's with a mock session service. |
|
||||
| Secure chat | **Works** (`SignedMessageChain`, `LastSeenMessagesValidator`, `MessageSignatureCache`): the chat session update and its profile key, checked against the services' `playerCertificateKeys`; signed chat, `say`, `me` and `msg`, relayed with their signatures and last-seen lists; `enforce-secure-profile` (with `online-mode`) refuses unsigned chat; and vanilla's log lines (`[Not Secure]`, the decoder's warnings, the kicks). Offline servers and players without a chat session chat unsigned, as on vanilla. `test_secure_chat_parity.py` runs the same signed and unsigned players against vanilla's server and Horizon's, with test keys and a mock services server. |
|
||||
| Nether and End | **Players can't change dimension.** The engine keeps one dimension loaded (`Game::enter_dimension` moves only the local single-player player), and the hub serves one `dimension` to everyone. |
|
||||
| Refused logins | Logged as vanilla does: `Disconnecting <name> (/address): <reason>`, then `<name> (/address) lost connection: <reason>`, and the session errors (`Username '<name>' tried to join with an invalid session`, `Couldn't verify username because servers are unavailable`). |
|
||||
| Gameplay for remote players | The LAN guest leftovers apply: an item used on a block is used twice, the recipe book doesn't work, status effects don't apply to guests, arrows don't record their owner, team friendly fire is ignored (#484). Block desync and short freezes are reported on a same-machine server (#500). |
|
||||
@@ -144,16 +150,22 @@ game built in `Game::new`, the integrated server on its own thread. On that base
|
||||
1. The dedicated path skips everything only a window uses: the HUD atlas, item renderer, block-entity and
|
||||
entity models, panorama, fog, music, and mesh tables (perf-ticks-2 already stops server-side meshing).
|
||||
This is the RAM and start-time item.
|
||||
2. The game moves into a library crate, with the window, audio and controller parts behind a `client`
|
||||
feature. A `horizon-engine` binary built without that feature links no wgpu, winit, cpal or gilrs, and
|
||||
needs neither ALSA nor udev. The supervisor finds it beside itself and falls back to `horizon-client`.
|
||||
2. The game moves into a library crate, with the window parts behind a `client` feature, so
|
||||
`horizon-engine` links no wgpu or winit either. Sound and controllers are already optional (the
|
||||
`audio` and `controllers` features, on by default): `horizon-engine` today is the game built without
|
||||
them (section 3).
|
||||
|
||||
## 3. Packaging
|
||||
|
||||
**Binaries.** The release archives already hold `horizon-client`, `horizon-ctl` and `horizon-prepare`.
|
||||
`horizon-server` joins them (PR 3: `xtask package` and `release.yml` build it and check it starts). Once
|
||||
`horizon-engine` exists (section 2), a separate small archive per platform
|
||||
(`horizon-server-<os>-<arch>.tar.gz` or `.zip`) holds just the server's binaries.
|
||||
**Binaries.** The release archives hold `horizon-client`, `horizon-ctl`, `horizon-prepare` and
|
||||
`horizon-server`. On Linux the release also has `horizon-server-linux-x86_64.tar.gz`: `horizon-server`,
|
||||
`horizon-prepare` and `horizon-engine`, the game built with `--no-default-features` (no sound, no
|
||||
controllers), which links neither `libasound.so.2` nor `libudev.so.1`. `release.yml` builds it after the
|
||||
client archive (`xtask package-server`) and fails if `tools/check_imports.py --server` finds either library;
|
||||
CI lints the same build. `horizon-server` runs `horizon-engine` when it is beside it or on the PATH, else
|
||||
`horizon-client`. Build it yourself with `cargo build --release -p horizon-client --no-default-features`
|
||||
and copy `target/release/horizon-client` as `horizon-engine`. macOS and Windows have no such libraries to
|
||||
avoid, so they keep the one archive.
|
||||
|
||||
**Game files: the owner's own copy, as with `prepare`.** Nothing of Mojang's is redistributed and nothing is
|
||||
downloaded on the owner's behalf. `horizon-server` looks for prepared resources in this order:
|
||||
@@ -180,10 +192,16 @@ comes out of the headless-engine work.
|
||||
|
||||
- Linux and macOS:
|
||||
`curl -fsSL https://raw.githubusercontent.com/ludovic111/horizon/main/packaging/server/install.sh | sh`
|
||||
The script picks the release archive for the OS and architecture (Linux x86_64, macOS arm64), downloads
|
||||
it from GitHub Releases, and checks it against the SHA-256 GitHub publishes for each asset. It never asks
|
||||
for sudo. Options: `--version vX.Y.Z`, `--dir` (default `~/.local/share/horizon`), `--bin` (default
|
||||
`~/.local/bin`).
|
||||
The script picks the release archive for the OS and architecture (on Linux x86_64 the server archive,
|
||||
on macOS arm64 the game's), downloads it from GitHub Releases, and checks it against the SHA-256 GitHub
|
||||
publishes for each asset. It never asks for sudo. Options: `--version vX.Y.Z`, `--dir` (default
|
||||
`~/.local/share/horizon`), `--bin` (default `~/.local/bin`), and `--archive FILE` to install an archive
|
||||
already on the machine (a build of your own; no download and no checksum).
|
||||
A Linux release from before the server archive installs the full game, which links ALSA's and udev's
|
||||
libraries (`libasound.so.2`, `libudev.so.1`); minimal server images often lack them (Debian and Ubuntu:
|
||||
`sudo apt install libasound2 libudev1`, `libasound2t64` on Ubuntu 24.04 and later). Then the script lists
|
||||
any that are missing, `init` warns, and `run` stops at once with what to install, rather than restarting
|
||||
a game that can't load.
|
||||
- Windows:
|
||||
`irm https://raw.githubusercontent.com/ludovic111/horizon/main/packaging/server/install.ps1 | iex`
|
||||
The script does the same into `%LOCALAPPDATA%\Horizon` (`-Version`, `-Dir`), with junctions instead of
|
||||
@@ -195,8 +213,8 @@ comes out of the headless-engine work.
|
||||
(`horizon-prepare`, `horizon-server init`).
|
||||
|
||||
**Docker** (`packaging/server/Dockerfile`, built the same way as the relay's image): a multi-stage build that
|
||||
ends on `debian:bookworm-slim` as user `horizon`. It adds `libasound2` and `libudev1` until the headless engine
|
||||
lands. It uses volume `/data` for the server folder, takes the owner's prepared game files as a read-only
|
||||
ends on `debian:bookworm-slim` as user `horizon`, with the server build as `horizon-engine`, so the image needs
|
||||
no ALSA or udev. It uses volume `/data` for the server folder, takes the owner's prepared game files as a read-only
|
||||
mount on `/opt/horizon/.local/horizon-client/26.3`, exposes port `25565/tcp`, and keeps the control API (and
|
||||
later the panel) on 127.0.0.1 inside the container: `docker exec <name> horizon-server status|cmd|backup`.
|
||||
On the first start, `HORIZON_EULA=true` and `HORIZON_WORLD`, `HORIZON_SEED`, `HORIZON_PORT`,
|
||||
@@ -479,6 +497,30 @@ reproducible by anyone, and show the same gameplay on both sides.
|
||||
and every packet woke its connection's writer thread (#649). Together they took the 50-bot walking tick
|
||||
from 281 ms to 31 ms. At 25 walking bots most of what remains is the engine's streaming and block entity
|
||||
ticks, both of which grow with players (the README has the profile).
|
||||
- **Mixed bots, as installed (2026-10-18,** `benchmarks/server-mixed-2026-10-18/`, the first published
|
||||
run for the working version). It used the v2026.10.18.15 release as `install.sh` installs it, against
|
||||
vanilla 26.3, with 1, 10, 25 and 50 `mixed` bots and vanilla's default game rules on both (Horizon has
|
||||
the locator bar now). The servers ran on the ThinkPad and the bots on the Mac mini. Results:
|
||||
- Both kept 20 TPS in every run.
|
||||
- Horizon's RSS was 3.7 to 5.2 times smaller (1.0 GB against 4.0 GB at 50).
|
||||
- Horizon's average tick was shorter with 1, 10 and 25 bots (2.4 against 17.9 ms, 12.4 against 34.5,
|
||||
24.0 against 31.6) and longer with 50 (35.2 against 29.7). Its P99 was lower at every count.
|
||||
- Horizon also did more work: it kept up with the exploring bots, so it generated 1.9 to 2.9 times
|
||||
the new terrain a second.
|
||||
- **Mixed bots, equal work (2026-10-18,** `benchmarks/server-equal-mixed-2026-10-18/`). This is the same
|
||||
run with the load made equal. The explore bots fly at 0.8 blocks a second, so every bot follows the same
|
||||
path on both servers and none waits for terrain. A 300-second warm-up lets both finish the bots' first
|
||||
views before the measurement. `server_bench.py` now prints a work table that compares each count's chunks
|
||||
a second across servers and flags a run that isn't equal. Horizon ran as `horizon-engine`, the server
|
||||
build, installed from its archive. Results, on the ThinkPad again (the desktop didn't wake):
|
||||
- The work was equal at 1 and 10 bots. At 25 the chunks sent a second were equal (158.6 against 157.6),
|
||||
and vanilla still sent 2.5 more first-time chunks a second while it caught up.
|
||||
- Tick: 1.8 against 11.3 ms at 1 bot, 4.7 against 34.3 at 10, 11.7 against 50.5 at 25 (vanilla 19.8 TPS).
|
||||
At 50 Horizon ran at 23.8 ms. Vanilla's watchdog stopped its server 30 s after the last bot joined (a
|
||||
60-second tick). This is one pass, to repeat on a bigger machine.
|
||||
- Horizon's RSS was 4.1 to 4.9 times smaller (1.03 GB at 50).
|
||||
- Served in full, vanilla's walking bots got 5400 to 6100 chunks each, against 640 to 1100 in the first
|
||||
run. That is why vanilla held 50 bots there and not here.
|
||||
- **Ownership.** perf-server-1 owns making the tick faster. This work only measures it, files what it finds,
|
||||
and fixes startup, RAM and packaging.
|
||||
|
||||
@@ -497,7 +539,8 @@ vanilla.
|
||||
archive in the release.
|
||||
3. The web panel MVP: status, live TPS/MSPT/RAM/CPU, players, console, backups and login links.
|
||||
4. `horizon-bots` and `tools/server_bench.py`, with a first run against vanilla (1/10/25/50 bots, `mixed`)
|
||||
published in `benchmarks/`.
|
||||
published in `benchmarks/`: done, `benchmarks/server-mixed-2026-10-18/`, and with equal work
|
||||
`benchmarks/server-equal-mixed-2026-10-18/` (section 9).
|
||||
5. Small engine fixes found on the way: logging refused logins (vanilla's lines).
|
||||
|
||||
**Where it stands (2026-10-16):** items 1 to 4 are built and in review (section 11). What's left for the 23rd:
|
||||
@@ -507,7 +550,6 @@ machine, then published in `benchmarks/`; and item 5.
|
||||
|
||||
**Out (next):**
|
||||
|
||||
- secure chat on the server (online mode itself works);
|
||||
- the Nether and End for remote players;
|
||||
- the headless engine and its RAM win;
|
||||
- a server-only prepare without a JDK;
|
||||
|
||||
@@ -258,7 +258,7 @@ A `shaders/` folder of GLSL programs, named by where Iris (and OptiFine before i
|
||||
| Custom textures, `noisetex` | easy | image loads |
|
||||
| Custom uniforms (`uniform.*` expressions) | medium | a small expression evaluator per frame |
|
||||
| Compute (`.csh`), `image2D` load/store | medium | wgpu has compute; storage formats are more limited than OpenGL's |
|
||||
| Distant Horizons, Voxy hooks, `DH_*` | not planned | Horizon has no LOD terrain yet |
|
||||
| Distant Horizons, Voxy hooks, `DH_*` | not planned | Horizon's native LOD terrain shares world colour/depth; it does not expose these mods' APIs |
|
||||
|
||||
Order: preprocessor and legaliser until the three test packs parse; then `composite`/`final`/`deferred` with the
|
||||
uniforms; then `gbuffers_terrain`, `gbuffers_water` and `gbuffers_skybasic`/`skytextured` (the packs' look comes
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# Constant surface-rule specialization benchmark
|
||||
|
||||
The upstream PR contains only the surface change and tests, reapplied to upstream main. The measurements below were collected with #796 present; they are historical incremental measurements, not new timings for the rebased upstream head.
|
||||
|
||||
This surface-only change is based on the bulk unary density optimization in [upstream PR #796](https://github.com/ludovic111/horizon/pull/796). Measurements compare against `eb3789038e3184c98a1459fe638947200217d360`, which already includes that optimization; its savings are not counted again.
|
||||
|
||||
With one worker, primary initialized Overworld terrain time improved from 10.664 to 10.298 ms/input chunk (3.43%). Terrain plus decoration improved from 12.645 to 12.242 (3.19%). With four workers, terrain improved 2.48% and combined time 2.07%. Nether terrain improved 4.16% / 3.93% with one/four workers; combined improved 3.76% / 3.63%. The second Overworld site improved terrain 2.53% / 2.81%. End improved 2.95% with one worker but regressed 2.93% with four, with substantial paired noise. This meets the revised 3% median gate on selected representative cases, not the original 5% gate or every workload.
|
||||
|
||||
Cases were declared before editing. Each used one discarded pair followed by five alternating baseline/candidate pairs, with identical work and builds. The primary case used seed 12345, center (0,0), 256 terrain chunks and 196 decorated interior chunks, at one/four workers across all three dimensions. The second Overworld case used seed -1 at (32,-32). An offset 9×9 generation pass initialized the same seeded generator without pre-generating the measured region. Wall time is elapsed/input count; combined time includes the complete decoration phase and required borders. Cold startup was measured separately.
|
||||
|
||||
Machine: AMD Ryzen 5 5600X, 32 GiB RAM, Linux, Rust 1.99.0. Optimized `fast` profile: release optimization, LTO off, 16 codegen units. Runs and builds were sequential; background desktop activity was not isolated. Memory use was effectively unchanged. The benchmark used the existing chunkgen benchmark with identical optional initialization and exact timing instrumentation on both revisions. `crates/horizon-world/examples/chunkgen_bench.rs` is the standard workload entry point; its thread-multiplied human-readable ms/chunk display differs from actual elapsed/count.
|
||||
|
||||
Validation passed: 102 targeted Rust tests; 162 world-crate tests; 24 exact complete-field baseline/candidate terrain and decorated comparisons across three dimensions, two sites/seeds, and one/four workers; and six fresh pinned Java 26.3 client/server suites covering material stages, rule library, conditions, temperature, extensions, and surface generation. Differential snapshots included block states/palettes, quart biomes, binary entities/block entities, scheduled ticks, all six heightmaps, ordered postprocessing, non-air counts, and chunk metadata. Compilation/binding errors, dynamic queries, and short-circuit behavior have regression coverage. The final production executable matched the measured candidate byte-for-byte.
|
||||
|
||||
The repository quick PR check also passed public-tree validation, Python tests, formatting, clippy, and world tests. Validation is scoped to the declared corpora and does not establish complete gameplay parity. Generated timing files, diagnostic runners, patches, and validation logs are retained locally outside the repository and are not included in this PR.
|
||||
Reference in New Issue
Block a user