[PR #1541] [MERGED] Each crate's probe example gets its own target name, so parallel harnesses can't run another crate's probe #3571

Closed
opened 2026-11-03 04:10:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1541
Author: @ludovic111
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @ludovic111

Base: main ← Head: fix/probe-target-names


📝 Commits (1)

  • 0b581f9 Give each crate's probe example its own target name

📊 Changes

227 files changed (+498 additions, -425 deletions)

View changed files

📝 crates/horizon-client/Cargo.toml (+5 -0)
📝 crates/horizon-client/examples/probe/dispatch.rs (+1 -1)
📝 crates/horizon-protocol/Cargo.toml (+5 -0)
📝 crates/horizon-protocol/examples/probe.rs (+1 -1)
📝 crates/horizon-world/Cargo.toml (+5 -0)
📝 crates/horizon-world/examples/probe/dispatch.rs (+1 -1)
📝 docs/parity-workflow.md (+1 -1)
📝 tests/test_parity_runner.py (+36 -1)
📝 tools/audio_harness.py (+2 -2)
📝 tools/block_update_harness.py (+1 -1)
📝 tools/interaction_lab.py (+2 -1)
📝 tools/oracle_harness.py (+2 -2)
📝 tools/parity.py (+29 -7)
📝 tools/port_regen.py (+2 -2)
📝 tools/test_active_effect_tick_parity.py (+2 -2)
📝 tools/test_active_effects_parity.py (+2 -2)
📝 tools/test_anchor_parity.py (+2 -2)
📝 tools/test_arrow_parity.py (+2 -2)
📝 tools/test_attribute_health_parity.py (+2 -2)
📝 tools/test_attribute_map_queries_parity.py (+2 -2)

...and 80 more files

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

horizon-client, horizon-world and horizon-protocol each had an example named probe. They are now client_probe, world_probe and protocol_probe ([[example]] in each Cargo.toml; the files stay in examples/probe/ and examples/probe.rs), and every harness builds and runs its own crate's name.

Why

Cargo copies every crate's examples into one <target>/<profile>/examples/ directory, and it does so even when the unit is fresh. Parity harnesses run in parallel against one target dir, so a harness could build its crate's probe while another harness re-copied the other crate's probe over it, and then run the wrong binary.

Before (CI parity run 40055656303, PR #1536): command_parse ran probe command_parse_fixture ... and got the horizon-world dispatcher. It exited 2 and printed world's fixture list (entity_obstruction_fixture extra_items_fixture ...). 309 of 310 harnesses passed, so it was a race, and any PR's parity could hit it.

Before, on origin/main's manifests (Mac mini, parity target):

$ cargo build --locked --release -p horizon-client --example probe -p horizon-world --example probe
warning: output filename collision at .../.local/parity-target/release/examples/probe
  = note: the example target `probe` in package `horizon-world v0.1.0 (...)` has the same output filename as the example target `probe` in package `horizon-client v0.1.0 (...)`
warning: output filename collision at .../.local/parity-target/release/examples/probe.dSYM

How

  • 217 harnesses and helpers in tools/ were rewritten by script, one crate per file (the script asserted that no file builds two crates' probes): the --example probe arguments and the <profile>/examples/probe[.exe] paths. Source paths (crates/<crate>/examples/probe/<fixture>.rs) don't change. interaction_lab.cargo_example derives the name from its package argument.
  • tools/parity.py:
    • PROBE_TARGETS maps each crate to its probe target.
    • probes_run recognises client_probe/world_probe/protocol_probe (with or without .exe) and cargo run --example <name> (also --example=<name>, through artifacts_of). The old probe and other *_probe examples such as mod_port_probe no longer count.
    • PROBE_SOURCE still matches the unchanged examples/probe/ directories.
    • New recorded_artifacts: the gathered prebuild records rename a stale ["example", "probe", ...] to the crate named by its -p selection, or (for the 6 pre-selection datafix#N records) to the crate whose probe sources the record depended on. Without it, prebuild_commands would silently drop them as targets that no longer exist. Before this run the shared records held 224 such entries (81 -p horizon-client, 143 -p horizon-world, plus the 6 with no selection), and every one resolves.
    • New unit tests: test_probe_names_are_each_crates_own_target and test_records_of_the_shared_probe_name_build_their_crates_probe. The existing probe test now uses the new names.
  • The dispatchers' usage line, docs/parity-workflow.md and the protocol probe's doc comment use the new names.

How tested (Mac mini)

$ cargo build --locked --release -p horizon-client --example client_probe -p horizon-world --example world_probe [-p horizon-protocol --example protocol_probe]
    Finished `release` profile [optimized] target(s)        # 0 "output filename collision" lines
$ ls .local/parity-target/release/examples/ | grep -E '^[a-z]*_?probe$'
client_probe  protocol_probe  world_probe              # no `probe`

$ python3 tools/parity.py --hosts "" command_parse entity_obstruction world_options player_sync cauldron auto_jump \
    audio_attributes block_removal composter arrow block_entity_tickers block_landing ground_support held_drop \
    material_stage section_mesh stepped_interpolation tick translucency world_spawn collision level_place \
    mob_attributes trading simple_block climbing entity_death_loot block_entity_anim face_visibility anchor \
    active_effects nether_portal datafix chunk_generation natural_spawn enchanting light material_extension
Probes built in 388s.            # prebuild from the old `probe` records, renamed
46 passed, 0 failed in 29.3 min.

The set covers each edited code shape at least once:

  • all three crates: world_options and player_sync are the horizon-protocol packet harnesses;
  • the dev, fast and release profiles;
  • cargo run and cargo build forms;
  • the helpers: interaction_lab (cauldron), oracle_harness (auto_jump), audio_harness (audio_attributes) and block_update_harness (block_removal, composter);
  • lab.cargo_target(), target_dir() and "world_probe" + suffix.

Afterwards the runner's records name only world_probe and client_probe.

$ rg -n -e "--example['\"]?\s*[,=]?\s*['\"]?probe\b" -e "['\"]probe(\.exe)?['\"]" tools      # only parity.py's stale-record mapping
$ rg -U -c -e "--example['\"],\s*\n\s*['\"]probe['\"]" tools                                # none
$ cargo fmt --all --check                                                                     # ok
$ cargo clippy --locked --workspace --all-targets -- -D warnings                              # ok
$ python3 -m unittest discover -s tests -q
Ran 289 tests: 2 errors, the same 2 as on origin/main (287 tests): OracleReuseTests.test_reuses_until_an_input_or_output_changes and test_rust_parity...test_report_rejects_sources_changed_during_a_run (java exits 127 in the test env)

No open PR adds a new --example probe use (checked the diffs of the open PRs).

Needs Ludovic

Nothing. Branches cut before this merge that add a harness with --example probe will fail to build that probe once they're rebased. The fix is to use the crate's name.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1541 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/probe-target-names` --- ### 📝 Commits (1) - [`0b581f9`](https://github.com/horizon-rust/horizon/commit/0b581f9ffec685939cba8c30efa97c429f14f7a8) Give each crate's probe example its own target name ### 📊 Changes **227 files changed** (+498 additions, -425 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/Cargo.toml` (+5 -0) 📝 `crates/horizon-client/examples/probe/dispatch.rs` (+1 -1) 📝 `crates/horizon-protocol/Cargo.toml` (+5 -0) 📝 `crates/horizon-protocol/examples/probe.rs` (+1 -1) 📝 `crates/horizon-world/Cargo.toml` (+5 -0) 📝 `crates/horizon-world/examples/probe/dispatch.rs` (+1 -1) 📝 `docs/parity-workflow.md` (+1 -1) 📝 `tests/test_parity_runner.py` (+36 -1) 📝 `tools/audio_harness.py` (+2 -2) 📝 `tools/block_update_harness.py` (+1 -1) 📝 `tools/interaction_lab.py` (+2 -1) 📝 `tools/oracle_harness.py` (+2 -2) 📝 `tools/parity.py` (+29 -7) 📝 `tools/port_regen.py` (+2 -2) 📝 `tools/test_active_effect_tick_parity.py` (+2 -2) 📝 `tools/test_active_effects_parity.py` (+2 -2) 📝 `tools/test_anchor_parity.py` (+2 -2) 📝 `tools/test_arrow_parity.py` (+2 -2) 📝 `tools/test_attribute_health_parity.py` (+2 -2) 📝 `tools/test_attribute_map_queries_parity.py` (+2 -2) _...and 80 more files_ </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What `horizon-client`, `horizon-world` and `horizon-protocol` each had an example named `probe`. They are now `client_probe`, `world_probe` and `protocol_probe` (`[[example]]` in each `Cargo.toml`; the files stay in `examples/probe/` and `examples/probe.rs`), and every harness builds and runs its own crate's name. ## Why Cargo copies every crate's examples into one `<target>/<profile>/examples/` directory, and it does so even when the unit is fresh. Parity harnesses run in parallel against one target dir, so a harness could build its crate's probe while another harness re-copied the other crate's `probe` over it, and then run the wrong binary. Before (CI parity run 40055656303, PR #1536): `command_parse` ran `probe command_parse_fixture ...` and got the horizon-world dispatcher. It exited 2 and printed world's fixture list (`entity_obstruction_fixture extra_items_fixture ...`). 309 of 310 harnesses passed, so it was a race, and any PR's parity could hit it. Before, on origin/main's manifests (Mac mini, parity target): ``` $ cargo build --locked --release -p horizon-client --example probe -p horizon-world --example probe warning: output filename collision at .../.local/parity-target/release/examples/probe = note: the example target `probe` in package `horizon-world v0.1.0 (...)` has the same output filename as the example target `probe` in package `horizon-client v0.1.0 (...)` warning: output filename collision at .../.local/parity-target/release/examples/probe.dSYM ``` ## How - 217 harnesses and helpers in `tools/` were rewritten by script, one crate per file (the script asserted that no file builds two crates' probes): the `--example probe` arguments and the `<profile>/examples/probe[.exe]` paths. Source paths (`crates/<crate>/examples/probe/<fixture>.rs`) don't change. `interaction_lab.cargo_example` derives the name from its `package` argument. - `tools/parity.py`: - `PROBE_TARGETS` maps each crate to its probe target. - `probes_run` recognises `client_probe`/`world_probe`/`protocol_probe` (with or without `.exe`) and `cargo run --example <name>` (also `--example=<name>`, through `artifacts_of`). The old `probe` and other `*_probe` examples such as `mod_port_probe` no longer count. - `PROBE_SOURCE` still matches the unchanged `examples/probe/` directories. - New `recorded_artifacts`: the gathered prebuild records rename a stale `["example", "probe", ...]` to the crate named by its `-p` selection, or (for the 6 pre-selection `datafix#N` records) to the crate whose probe sources the record depended on. Without it, `prebuild_commands` would silently drop them as targets that no longer exist. Before this run the shared records held 224 such entries (81 `-p horizon-client`, 143 `-p horizon-world`, plus the 6 with no selection), and every one resolves. - New unit tests: `test_probe_names_are_each_crates_own_target` and `test_records_of_the_shared_probe_name_build_their_crates_probe`. The existing probe test now uses the new names. - The dispatchers' usage line, `docs/parity-workflow.md` and the protocol probe's doc comment use the new names. ## How tested (Mac mini) ``` $ cargo build --locked --release -p horizon-client --example client_probe -p horizon-world --example world_probe [-p horizon-protocol --example protocol_probe] Finished `release` profile [optimized] target(s) # 0 "output filename collision" lines $ ls .local/parity-target/release/examples/ | grep -E '^[a-z]*_?probe$' client_probe protocol_probe world_probe # no `probe` $ python3 tools/parity.py --hosts "" command_parse entity_obstruction world_options player_sync cauldron auto_jump \ audio_attributes block_removal composter arrow block_entity_tickers block_landing ground_support held_drop \ material_stage section_mesh stepped_interpolation tick translucency world_spawn collision level_place \ mob_attributes trading simple_block climbing entity_death_loot block_entity_anim face_visibility anchor \ active_effects nether_portal datafix chunk_generation natural_spawn enchanting light material_extension Probes built in 388s. # prebuild from the old `probe` records, renamed 46 passed, 0 failed in 29.3 min. ``` The set covers each edited code shape at least once: - all three crates: `world_options` and `player_sync` are the horizon-protocol packet harnesses; - the dev, fast and release profiles; - `cargo run` and `cargo build` forms; - the helpers: `interaction_lab` (cauldron), `oracle_harness` (auto_jump), `audio_harness` (audio_attributes) and `block_update_harness` (block_removal, composter); - `lab.cargo_target()`, `target_dir()` and `"world_probe" + suffix`. Afterwards the runner's records name only `world_probe` and `client_probe`. ``` $ rg -n -e "--example['\"]?\s*[,=]?\s*['\"]?probe\b" -e "['\"]probe(\.exe)?['\"]" tools # only parity.py's stale-record mapping $ rg -U -c -e "--example['\"],\s*\n\s*['\"]probe['\"]" tools # none $ cargo fmt --all --check # ok $ cargo clippy --locked --workspace --all-targets -- -D warnings # ok $ python3 -m unittest discover -s tests -q Ran 289 tests: 2 errors, the same 2 as on origin/main (287 tests): OracleReuseTests.test_reuses_until_an_input_or_output_changes and test_rust_parity...test_report_rejects_sources_changed_during_a_run (java exits 127 in the test env) ``` No open PR adds a new `--example probe` use (checked the diffs of the open PRs). ## Needs Ludovic Nothing. Branches cut before this merge that add a harness with `--example probe` will fail to build that probe once they're rebased. The fix is to use the crate's name. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:10:31 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3571
No description provided.