Skip to content

fix: fold duplication batches 5-7 (#200, #201, #202) into one CI cycle - #204

Merged
starswallow merged 8 commits into
mainfrom
integration/duplication-batches
Sep 6, 2026
Merged

starswallow merged 8 commits into
mainfrom
integration/duplication-batches

Conversation

@starswallow

Copy link
Copy Markdown
Collaborator

Folds #200, #201 and #202 onto current main. No new work — the three branches merged with zero conflicts, and the net diff is exactly their union.

Why fold rather than merge three times

main requires seven status contexts with strict: true, so each merge forces every remaining PR to update and re-run the full ~70-job matrix. Three PRs is three sequential cycles; this is one. The same approach was used for the earlier batches.

PR Change Files
#200 fix(shm): two more hand-restated copies of geometry the layout module owns 3
#201 fix(cargo_gen): the workspace generator dropped the features it was asked for 1
#202 fix(registry): the installer's crate list omitted the one crate everyone uses 1

Net: 5 files, +220/-28. The three touch disjoint files apart from header.rs, which only #200 changes.

The one interaction worth checking

#200 was written before #203 landed, and #203 extracted read_slot_from_region out of read_slot_inner. Git placed #200's hunk inside the extracted function — which is the right outcome and slightly better than the original: the checked-arithmetic hardening now covers both the one-shot read and #203's cached TopicReader, which share that parser. Verified no hand-restated geometry survives in header.rs (only the comment describing what was removed), and #203's own SHM_MAP_COUNT placement is intact.

Why #201 was red and needs no fix

#201 changes exactly one file, horus_manager/src/cargo_gen.rs, and was failing two jobs that cannot reach it:

  • Code Coverage — cross_process_sigkill_mid_write_recovery in horus_core --test log_system_tests. A cross-process SIGKILL test, unrelated to the workspace generator.
  • Run Benchmarks — topic IPC benchmarks, with the whole distribution shifted: median +69%, p95 +83%, ns/msg +57%. A uniform scale-up like that is a slower runner, not a regression; a real one does not move the median and the throughput figure together while the changed file is not linked into the benchmark at all.

Verification on the folded tree

horus_core --lib 2588 passed, horus_sys --lib 248, pod_ring_slot_geometry 10, plus the RT guards from #203 (rt_helper_thread_isolation, ready_dispatch_pool). cargo fmt --check and clippy --all-targets -D warnings across horus_sys/horus_core/horus_manager are clean.

One horus_core scheduler test failed on the first run and passed 5/5 in isolation and on a clean re-run — the rotating parallel-test contention this workstation shows under load, not a defect in the fold.

Closes #200. Closes #201. Closes #202.

… owns

Fifth batch from the duplication audit.

1. read_slot_inner restated shm_layout's arithmetic in two of its three
   arms.

   The colo arm calls colo_required_region_len and colo_payload_offset.
   Three lines below it, the split arm wrote out
   TOPIC_HEADER_SIZE + capacity * 8 + capacity * type_size by hand, and
   the serde arm did the same with slot_size - both with bare `*` on two
   u32s read out of a header another process wrote. A release profile has
   no overflow-checks, so on a 32-bit controller the product wraps and a
   truncated file satisfies a check for a ring that does not fit.

   The split arm then took its slot with mmap[a..b], which panics, where
   the colo arm three lines up uses .get(..)?.

   Both now use required_region_len_checked and data_slot_offset. The
   helpers compute identical values for every shape checked, so this is a
   substitution, not a behaviour change - what changes is that the
   overflow and the bounds failure now return None instead of wrapping or
   panicking.

2. The .meta sidecar mapping was reimplemented in horus_manager.

   horus_sys builds it with sanitize_namespace, which maps every byte
   outside [A-Za-z0-9_] to _. horus_manager's stale-topic reaper built it
   as name.replace('.', "_"), which agrees only when the name's sole
   special character is a dot.

   Topic names legally carry -, / and . For `robot-arm/imu`, horus_sys
   writes robot_arm_imu.meta and the reaper looked for robot-arm/imu.meta
   - a path that cannot exist, since the / names a directory. Those
   sidecars were never reaped and accumulated for the life of the
   machine.

   Added horus_sys::shm::topic_meta_path as the single definition,
   alongside topic_shm_path; both horus_sys sites and the manager use it.
   Purely additive to the public surface.

Verified: fmt, clippy --workspace --all-targets -D warnings, horus_sys
224 tests, horus_manager 3497 tests, horus_core communication 664.
…sked for

Sixth batch from the duplication audit.

horus_dep_features turns `enable = ["net"]` in horus.toml - and
HORUS_ENABLE, which `horus run --net` sets - into the `net` cargo feature
on the horus dependency. It has exactly one caller,
write_horus_path_deps, which had exactly one caller: the single-package
generator.

The workspace generator carried its own copy of that loop:

    "{} = {{ path = \"{}\" }}"

against the shared writer's

    "{} = {{ path = \"{}\", features = [{}] }}"

Same four dependency names, same output shape, one clause missing. So
`enable = ["net"]` and `horus run --net` were honoured for a
single-package project and dropped for every workspace project - the
feature was parsed, resolved into a Vec, and thrown away one generator
over, with no error. A user asking for LAN replication in a workspace got
a build without it.

Worth noting what that costs: the replication seam this feature gates is
the same one #80 found broken in horus_net for four months. A silently
feature-less build is exactly the condition under which nobody notices.

The workspace generator now calls write_horus_path_deps. Members inherit
through `horus.workspace = true`.

The test asserts on the emitted TOML rather than on horus_dep_features
alone, because the function was never the broken part - it returned the
right Vec the whole time and had no second caller to hand it to.

Verified: fmt, clippy -p horus_manager --all-targets -D warnings,
cargo_gen 105 tests, horus_manager lib suite.
…one uses

Seventh batch from the duplication audit.

cargo_toml_has_horus_deps gates whether `horus install` injects the
[patch] path overrides that point cargo at the local HORUS source tree.
It named three crates:

    deps.contains_key("horus_core")
        || deps.contains_key("horus_library")
        || deps.contains_key("horus_macros")

`horus` is not among them - the facade crate that `horus new` writes into
every scaffold and that every documented example imports as
`use horus::prelude::*`. So a published package whose Cargo.toml says
`horus = "0.4.1"` was not recognised as depending on HORUS at all, and
the overrides were never injected for it. The check meant to catch HORUS
packages caught only the shapes nobody writes by hand.

error_wrapper::FIRST_PARTY_CRATES is the canonical list - thirteen names,
with a doc explaining precisely why they matter and what cargo says when
they cannot be resolved. The installer carried a three-name copy, and its
own doc comment restated the same three, so the code and its
documentation agreed with each other and disagreed with reality. That is
what makes this class hard to spot by reading.

Now calls is_first_party_crate. Doc corrected to name the set rather than
enumerate a stale subset of it.

Ablation: with the three-name list restored, the new test fails on
`horus = "0.4.1"`. It also asserts an unrelated package is still NOT
matched, so the check cannot pass by becoming indiscriminate.

Verified: fmt, clippy -p horus_manager --all-targets -D warnings,
registry 187 tests, error_wrapper 86 tests.
… for

Two assertions in the meta_path test did not discriminate, both raised in
review on #200:

* Checking only file_name()/stem is blind to the actual failure. A mapping
  that let `/` through yields <topics>/robot-arm/imu.meta, whose file_name
  is imu.meta and whose stem is imu — the existing assertions pass. What
  breaks the reaper is the sidecar not being a direct child of the topics
  directory, so assert the parent.

* The dot-only regression guard compared file_name() against a string
  containing a path separator. A file name cannot contain one, so it held
  regardless of what topic_meta_path returned. Compare whole paths.

Ablation: restoring the naive name.replace('.', "_") mapping now fails on
both assertions independently (parent, then, with the loop neutered, the
whole-path comparison).
Copilot AI lite review requested due to automatic review settings September 6, 2026 06:03
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Benchmark gate

Baseline: rolling window of 8 run(s) on AMD EPYC 7763 64-Core Processor. Current arm: median of 6 repetition(s).

Result: PASS

Adaptive_CmdVel@16B — 50000 samples
metric baseline current change band (<=) verdict
median 40.0 ns 40.0 ns +0.0% 65.0 ns INCONCLUSIVE
p95 50.0 ns 50.0 ns +0.0% 100.0 ns INCONCLUSIVE
p99 69.0 ns 69.0 ns +0.0% 169.0 ns INCONCLUSIVE
p99.9 80.0 ns 80.0 ns +0.0% 330.0 ns INCONCLUSIVE
p99.99 — 190.0 ns — — N/A (samples)
max 15.92 µs 13.07 µs -17.9% 31.85 µs INCONCLUSIVE
max_jitter 15.91 µs 13.06 µs -17.9% 31.83 µs INCONCLUSIVE
p99/median 1.73x 1.73x +0.0% 2.23x INCONCLUSIVE
p99.9/median 2.00x 2.00x +0.0% 3.00x INCONCLUSIVE
ns/msg 170.3 ns 170.0 ns -0.2% 220.3 ns INCONCLUSIVE
Adaptive_Imu@304B — 50000 samples
metric baseline current change band (<=) verdict
median 40.0 ns 40.0 ns +0.0% 65.0 ns INCONCLUSIVE
p95 60.0 ns 60.0 ns +0.0% 110.0 ns INCONCLUSIVE
p99 89.5 ns 89.0 ns -0.6% 189.5 ns INCONCLUSIVE
p99.9 110.0 ns 110.0 ns +0.0% 360.0 ns INCONCLUSIVE
p99.99 — 160.0 ns — — N/A (samples)
max 13.85 µs 14.87 µs +7.3% 27.70 µs INCONCLUSIVE
max_jitter 13.83 µs 14.85 µs +7.3% 27.66 µs INCONCLUSIVE
p99/median 2.24x 2.23x -0.6% 2.80x INCONCLUSIVE
p99.9/median 2.75x 2.75x +0.0% 3.75x INCONCLUSIVE
ns/msg 270.3 ns 268.4 ns -0.7% 324.3 ns INCONCLUSIVE
Adaptive_JointCommand@928B — 50000 samples
metric baseline current change band (<=) verdict
median 80.0 ns 80.0 ns +0.0% 105.0 ns INCONCLUSIVE
p95 100.0 ns 100.0 ns +0.0% 150.0 ns INCONCLUSIVE
p99 130.0 ns 130.0 ns +0.0% 230.0 ns INCONCLUSIVE
p99.9 160.0 ns 160.0 ns +0.0% 410.0 ns INCONCLUSIVE
p99.99 — 12.05 µs — — N/A (samples)
max 15.53 µs 15.91 µs +2.4% 31.07 µs INCONCLUSIVE
max_jitter 15.48 µs 15.86 µs +2.4% 30.97 µs INCONCLUSIVE
p99/median 1.62x 1.62x +0.0% 2.12x INCONCLUSIVE
p99.9/median 2.00x 2.00x +0.0% 3.00x INCONCLUSIVE
ns/msg 335.0 ns 330.9 ns -1.2% 402.0 ns INCONCLUSIVE
Adaptive_LaserScan@1480B — 10000 samples
metric baseline current change band (<=) verdict
median 89.0 ns 89.0 ns +0.0% 114.0 ns INCONCLUSIVE
p95 110.0 ns 110.0 ns +0.0% 160.0 ns INCONCLUSIVE
p99 150.0 ns 150.0 ns +0.0% 250.0 ns INCONCLUSIVE
p99.9 170.0 ns 180.0 ns +5.9% 420.0 ns INCONCLUSIVE
p99.99 — 301.0 ns — — N/A (samples)
max 13.15 µs 12.55 µs -4.5% 26.30 µs INCONCLUSIVE
max_jitter 13.09 µs 12.49 µs -4.6% 26.18 µs INCONCLUSIVE
p99/median 1.69x 1.69x +0.0% 2.19x INCONCLUSIVE
p99.9/median 1.91x 2.02x +5.9% 2.91x INCONCLUSIVE
ns/msg 689.0 ns 687.5 ns -0.2% 826.8 ns INCONCLUSIVE
Topic_cross_process_oneway_paced_stream@1024B — 200000 samples
metric baseline current change band (<=) verdict
median 260.5 ns 261.0 ns +0.2% 316.8 ns INCONCLUSIVE
p95 323.0 ns 391.0 ns +21.1% 468.3 ns INCONCLUSIVE
p99 597.5 ns 581.0 ns -2.8% 905.9 ns INCONCLUSIVE
p99.9 4.92 µs 2.94 µs -40.1% 16.22 µs INCONCLUSIVE
p99.99 15.34 µs 13.16 µs -14.2% 24.58 µs INCONCLUSIVE
max 35.19 µs 37.96 µs +7.9% 79.53 µs INCONCLUSIVE
max_jitter 34.99 µs 37.76 µs +7.9% 79.20 µs INCONCLUSIVE
p99/median 2.33x 2.23x -4.5% 3.91x INCONCLUSIVE
p99.9/median 19.48x 11.28x -42.1% 71.66x INCONCLUSIVE
ns/msg 10.00 µs 10.00 µs -0.0% 12.00 µs INCONCLUSIVE
Topic_cross_process_oneway_paced_stream@64B — 200000 samples
metric baseline current change band (<=) verdict
median 170.5 ns 171.0 ns +0.3% 203.1 ns INCONCLUSIVE
p95 205.5 ns 201.0 ns -2.2% 267.8 ns INCONCLUSIVE
p99 468.0 ns 451.0 ns -3.6% 1.03 µs INCONCLUSIVE
p99.9 3.75 µs 5.50 µs +46.8% 13.44 µs INCONCLUSIVE
p99.99 13.08 µs 16.39 µs +25.3% 26.19 µs INCONCLUSIVE
max 51.25 µs 45.81 µs -10.6% 270.47 µs INCONCLUSIVE
max_jitter 51.13 µs 45.70 µs -10.6% 270.28 µs INCONCLUSIVE
p99/median 2.70x 2.64x -2.3% 5.43x INCONCLUSIVE
p99.9/median 20.29x 32.16x +58.5% 68.21x INCONCLUSIVE
ns/msg 10.00 µs 10.00 µs -0.0% 12.00 µs INCONCLUSIVE
Topic_cross_process_oneway_pingpong@1024B — 1000000 samples
metric baseline current change band (<=) verdict
median 278.0 ns 285.0 ns +2.5% 305.8 ns INCONCLUSIVE
p95 361.0 ns 366.0 ns +1.4% 415.1 ns INCONCLUSIVE
p99 408.5 ns 411.0 ns +0.6% 508.5 ns INCONCLUSIVE
p99.9 1.40 µs 1.33 µs -5.1% 1.96 µs INCONCLUSIVE
p99.99 10.48 µs 10.83 µs +3.3% 15.72 µs INCONCLUSIVE
max 27.51 µs 23.70 µs -13.8% 94.84 µs INCONCLUSIVE
max_jitter 27.31 µs 23.51 µs -13.9% 94.60 µs INCONCLUSIVE
p99/median 1.45x 1.43x -1.1% 1.95x INCONCLUSIVE
p99.9/median 4.97x 4.59x -7.5% 7.16x INCONCLUSIVE
ns/msg 344.5 ns 351.0 ns +1.9% 413.4 ns INCONCLUSIVE
Topic_cross_process_oneway_pingpong@64B — 1000000 samples
metric baseline current change band (<=) verdict
median 150.0 ns 145.0 ns -3.3% 179.7 ns INCONCLUSIVE
p95 180.0 ns 175.0 ns -2.8% 230.0 ns INCONCLUSIVE
p99 200.0 ns 195.0 ns -2.5% 300.0 ns INCONCLUSIVE
p99.9 728.5 ns 711.0 ns -2.4% 1.27 µs INCONCLUSIVE
p99.99 7.78 µs 7.58 µs -2.6% 11.67 µs INCONCLUSIVE
max 23.44 µs 19.47 µs -16.9% 60.24 µs INCONCLUSIVE
max_jitter 23.33 µs 19.36 µs -17.0% 60.09 µs INCONCLUSIVE
p99/median 1.34x 1.32x -1.6% 1.84x INCONCLUSIVE
p99.9/median 4.79x 4.80x +0.2% 7.76x INCONCLUSIVE
ns/msg 200.6 ns 196.2 ns -2.2% 250.6 ns INCONCLUSIVE
Topic_cross_process_unpaced_queue_delay@64B — 200000 samples
metric baseline current change band (<=) verdict
median 147.5 ns 150.0 ns +1.7% 197.9 ns INCONCLUSIVE
p95 205.0 ns 200.0 ns -2.4% 267.3 ns INCONCLUSIVE
p99 230.5 ns 231.0 ns +0.2% 330.5 ns INCONCLUSIVE
p99.9 3.18 µs 1.43 µs -54.9% 13.64 µs INCONCLUSIVE
p99.99 9.26 µs 8.54 µs -7.8% 13.89 µs INCONCLUSIVE
max 38.40 µs 20.68 µs -46.2% 80.93 µs INCONCLUSIVE
max_jitter 38.30 µs 20.58 µs -46.3% 80.76 µs INCONCLUSIVE
p99/median 1.60x 1.57x -2.3% 2.10x INCONCLUSIVE
p99.9/median 23.14x 10.16x -56.1% 108.60x INCONCLUSIVE
ns/msg 112.7 ns 110.8 ns -1.7% 162.7 ns INCONCLUSIVE

Blocking metrics: median, p99/median. Report-only: p95, p99, p99.9, p99.99, max, max_jitter, p99.9/median, ns/msg. Tail metrics past p99.9 are advisory on a shared runner — one host preemption owns max.

Raw benchmark output
1      40.1      160.3     38721.6 |      435        86
------------------------------------------------------------------------------------------------------------------------------------------
  samples=1000000  warmup=200000  transferred=2000000  lost=0  invalid(TSC-skew)=0  poll cost=12.7 ns  window=0.392 s
  measured window: minor_faults=0 major_faults=0 ctx_switches vol=77 invol=0
  core freq cpu3   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  core freq cpu1   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  cross-core TSC offset theta_hat = -5.1 ns (clock B - clock A). The `one-way, offset-free` row does not depend on it.

== cross-process ping-pong -- ONE-WAY LATENCY (2 processes, 2 topics, 1 role per handle) ==
   json metric key: `Topic_cross_process_oneway_pingpong` (identity used by the CI gate: `Topic_cross_process_oneway_pingpong@1024B`)
   payload Probe1k = 1024 B (POD=true) | ring capacity 256 slots | topology 1P/1C | cpu3 <-> cpu1 | pid 6265 <-> pid 6275
------------------------------------------------------------------------------------------------------------------------------------------
  metric (ns)                            n       min    median       p99     p99.9     p99.99         max |  n>p99.9  n>p99.99
------------------------------------------------------------------------------------------------------------------------------------------
  one-way, offset-free             1000000     195.1     290.3     415.9    1332.3    10909.9     23703.7 |     1000       100
  round trip (RTT)                 1000000     430.6     611.3     871.4    2805.2    21950.3     47447.5 |      999       100
  RTT halved (one-way)             1000000     215.3     305.7     435.7    1402.6    10975.1     23723.8 |      999       100
  leg A->B (apparent)              1000000     179.9     270.3     450.6     881.6    20667.9     46976.5 |     1000       100
  leg B->A (apparent)              1000000     180.3     290.7     451.0     711.5    10098.6     34884.8 |     1000       100
  responder turnaround             1000000      29.9      30.3      40.1      40.1      130.4     24284.8 |      799        99
------------------------------------------------------------------------------------------------------------------------------------------
  samples=1000000  warmup=200000  transferred=2000000  lost=0  invalid(TSC-skew)=0  poll cost=43.3 ns  window=0.704 s
  measured window: minor_faults=0 major_faults=0 ctx_switches vol=138 invol=6
  core freq cpu3   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  core freq cpu1   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  cross-core TSC offset theta_hat = -10.2 ns (clock B - clock A). The `one-way, offset-free` row does not depend on it.

== cross-process paced stream -- ONE-WAY LATENCY (10000 ns publish period, publisher -> subscriber, direct) ==
   json metric key: `Topic_cross_process_oneway_paced_stream` (identity used by the CI gate: `Topic_cross_process_oneway_paced_stream@64B`)
   payload Probe64 = 64 B (POD=true) | ring capacity 256 slots | topology 1P/1C | cpu3 <-> cpu1 | pid 6265 <-> pid 6277
------------------------------------------------------------------------------------------------------------------------------------------
  metric (ns)                            n       min    median       p99     p99.9     p99.99         max |  n>p99.9  n>p99.99
------------------------------------------------------------------------------------------------------------------------------------------
  one-way (assumes TSC coherence)    200000     110.4     170.5     381.1    3185.9    13635.4     30426.3 |      200        20
------------------------------------------------------------------------------------------------------------------------------------------
  samples=200000  warmup=20000  transferred=200000  lost=0  invalid(TSC-skew)=0  poll cost=8.6 ns  window=2.000 s
  measured backlog: 0.02 messages deep on the median sample (ring holds 256); delivered 100.0% of transferred
  measured window: minor_faults=0 major_faults=0 ctx_switches vol=393 invol=14
  core freq cpu3   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  core freq cpu1   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  this row assumes cross-core TSC coherence; theta_hat measured in the ping-pong at this size = -5.1 ns (add to correct).

== cross-process paced stream -- ONE-WAY LATENCY (10000 ns publish period, publisher -> subscriber, direct) ==
   json metric key: `Topic_cross_process_oneway_paced_stream` (identity used by the CI gate: `Topic_cross_process_oneway_paced_stream@1024B`)
   payload Probe1k = 1024 B (POD=true) | ring capacity 256 slots | topology 1P/1C | cpu3 <-> cpu1 | pid 6265 <-> pid 6279
------------------------------------------------------------------------------------------------------------------------------------------
  metric (ns)                            n       min    median       p99     p99.9     p99.99         max |  n>p99.9  n>p99.99
------------------------------------------------------------------------------------------------------------------------------------------
  one-way (assumes TSC coherence)    200000     200.4     260.9     581.5    4939.3    15348.3     29554.5 |      200        20
------------------------------------------------------------------------------------------------------------------------------------------
  samples=200000  warmup=20000  transferred=200000  lost=0  invalid(TSC-skew)=0  poll cost=20.0 ns  window=2.000 s
  measured backlog: 0.03 messages deep on the median sample (ring holds 256); delivered 100.0% of transferred
  measured window: minor_faults=0 major_faults=0 ctx_switches vol=393 invol=14
  core freq cpu3   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  core freq cpu1   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  this row assumes cross-core TSC coherence; theta_hat measured in the ping-pong at this size = -10.2 ns (add to correct).

== cross-process unpaced stream -- QUEUE DELAY / BACKPRESSURE, NOT LATENCY (publisher unthrottled; each sample includes its wait in the ring) ==
   !! Every number in this block is a PUBLISH-TO-RECEIVE DELAY that INCLUDES
   !! time spent waiting in the ring. It is a backpressure/throughput figure.
   !! Do not quote it as an IPC latency; that is the exact mistake the retired
   !! `Topic_cross_process` metric shipped for months. Read `measured backlog`
   !! below: ~1 message means the subscriber kept up and no queue formed.
   json metric key: `Topic_cross_process_unpaced_queue_delay` (identity used by the CI gate: `Topic_cross_process_unpaced_queue_delay@64B`)
   payload Probe64 = 64 B (POD=true) | ring capacity 256 slots | topology 1P/1C | cpu3 <-> cpu1 | pid 6265 <-> pid 6281
------------------------------------------------------------------------------------------------------------------------------------------
  metric (ns)                            n       min    median       p99     p99.9     p99.99         max |  n>p99.9  n>p99.99
------------------------------------------------------------------------------------------------------------------------------------------
  publish->receive incl. queue      200000     100.2     150.5     230.6    5450.5    10449.5     18153.9 |      200        20
------------------------------------------------------------------------------------------------------------------------------------------
  samples=200000  warmup=20000  transferred=200000  lost=0  invalid(TSC-skew)=0  poll cost=20.4 ns  window=0.022 s
  measured backlog: 1.36 messages deep on the median sample (ring holds 256); delivered 100.0% of transferred
  measured window: minor_faults=0 major_faults=0 ctx_switches vol=4 invol=0
  core freq cpu3   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  core freq cpu1   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  this row assumes cross-core TSC coherence; theta_hat measured in the ping-pong at this size = -5.1 ns (add to correct).

SUMMARY — one row per published JSON metric (nanoseconds, wall clock)
------------------------------------------------------------------------------------------------------------------------------------------
  json metric key                                what it measures                  n    median       p99     p99.9     p99.99         max
------------------------------------------------------------------------------------------------------------------------------------------
  Topic_cross_process_oneway_pingpong@64B        ONE-WAY latency             1000000     145.2     195.5     696.4     7949.8     24430.0
  Topic_cross_process_oneway_pingpong@1024B      ONE-WAY latency             1000000     290.3     415.9    1332.3    10909.9     23703.7
  Topic_cross_process_oneway_paced_stream@64B    ONE-WAY latency              200000     170.5     381.1    3185.9    13635.4     30426.3
  Topic_cross_process_oneway_paced_stream@1024B  ONE-WAY latency              200000     260.9     581.5    4939.3    15348.3     29554.5
  Topic_cross_process_unpaced_queue_delay@64B    QUEUE DELAY (not latency)    200000     150.5     230.6    5450.5    10449.5     18153.9
------------------------------------------------------------------------------------------------------------------------------------------
  Instrumentation is INCLUDED in every figure and never subtracted.
  `Topic_cross_process_oneway_pingpong` is the true one-way figure: it assumes
  nothing about cross-core TSC synchronisation and excludes the responder's turnaround.
  `RTT halved (one-way)` in the per-scenario tables is a ROUND TRIP DIVIDED BY TWO; it is
  the row to compare against any competitor publishing a halved ping-pong.
  `Topic_cross_process_unpaced_queue_delay` is a BACKPRESSURE figure: it includes
  however long the message waited in the ring, so it scales with the achieved backlog
  (printed in its scenario block) and is NOT a latency.
  A figure without its payload size, ring depth and topology is not comparable to anything.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! THE SAME WARNINGS AGAIN — they apply to every number above
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!  CPU governor is ?/?, not `performance`. RDTSC is a wall clock while the work costs a fixed number of CORE cycles, so every nanosecond below scales with a frequency the governor is free to change. iceoryx2's maintainers measured ~300 ns of difference from the governor alone.
!!  No isolcpus= on the kernel command line: the benchmark cores are shared with everything else on this box. The involuntary context-switch count in each scenario block is the mechanism behind the far tail.
!!  paced_stream (64 B) `one-way (assumes TSC coherence)`: p99.99 rests on 20 observations. Below ~100 exceedances it is a max wearing a percentile's name; +/-5% needs ~400 (--iterations 4000000).
!!  paced_stream (1024 B) `one-way (assumes TSC coherence)`: p99.99 rests on 20 observations. Below ~100 exceedances it is a max wearing a percentile's name; +/-5% needs ~400 (--iterations 4000000).
!!  unpaced_queue (64 B): measured backlog is only 1.36 messages — the subscriber kept up, so the ring never filled and `Topic_cross_process_unpaced_queue_delay` is NOT a backpressure figure on this run. It is a publish-to-receive delay with no queueing in it, and it is still not a latency (see the paced and ping-pong rows for that).
!!  unpaced_queue (64 B) `publish->receive incl. queue`: p99.99 rests on 20 observations. Below ~100 exceedances it is a max wearing a percentile's name; +/-5% needs ~400 (--iterations 4000000).
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Gate report written to /home/runner/work/horus/horus/benchmarks/gate-reports/cross_process-2.json
  keys: Topic_cross_process_oneway_pingpong@64B, Topic_cross_process_oneway_pingpong@1024B, Topic_cross_process_oneway_paced_stream@64B, Topic_cross_process_oneway_paced_stream@1024B, Topic_cross_process_unpaced_queue_delay@64B
  NOTE: `Topic_cross_process` is retired. A baseline window that still holds it
  will report it as missing and fail the gate until the window is refreshed —
  that is intended, and is why the key was not silently reused.
  Raw samples are omitted (pass --raw-in-json, or --raw-dir for a lossless cycle dump).
  6 warning(s) apply to these numbers and are NOT in this file; use --detail-json.
╔══════════════════════════════════════════════════════════════════╗
║        HORUS Robotics Message Types Benchmark                    ║
╠══════════════════════════════════════════════════════════════════╣
║  Testing real-world robotics message latency (REP 2014)          ║
╚══════════════════════════════════════════════════════════════════╝

Platform: AMD EPYC 7763 64-Core Processor (4 cores)
Iterations: 50000
Warmup: 5000

╔═════════════════════════════════════════════════════════════════════════════╗
║ Message Type    │ Size (bytes) │ Typical Rate │ Use Case                    ║
╠═════════════════════════════════════════════════════════════════════════════╣
║ CmdVel          │           16 │ 1000+ Hz     │ Velocity control commands   ║
║ Imu             │          296 │ 500+ Hz      │ IMU sensor fusion           ║
║ LaserScan       │         1480 │ 10-40 Hz     │ 2D lidar navigation         ║
║ JointCommand    │         1032 │ 500+ Hz      │ Manipulator control         ║
╚═════════════════════════════════════════════════════════════════════════════╝


[Topic] Running benchmarks — timing tx.send() enqueue cost only
        (cross-thread consumer drains in the background; no sample
         waits for delivery, so these are NOT end-to-end latencies)
─────────────────────────────────────────────────
  CmdVel              16 bytes │ median:      40ns │ p99:      69ns │ CV: 4.5348
  Imu                304 bytes │ median:      40ns │ p99:      89ns │ CV: 2.7356
  LaserScan         1480 bytes │ median:      89ns │ p99:     150ns │ CV: 1.3992
  JointCommand       928 bytes │ median:      80ns │ p99:     130ns │ CV: 1.9683

╔══════════════════════════════════════════════════════════════════════════════════════════╗
║           SUMMARY BY MESSAGE TYPE — send() ENQUEUE COST, not end-to-end latency           ║
╠══════════════════════════════════════════════════════════════════════════════════════════╣
║ Message      │   Size │ Median (ns) │ p99 (ns) │    CV   │ Misses │ Sustained rate       ║
╠══════════════════════════════════════════════════════════════════════════════════════════╣
║ CmdVel       │     16 │          40 │       69 │  4.5348 │      0 │      5.87 M msg/s     ║
║ Imu          │    304 │          40 │       89 │  2.7356 │      0 │      3.73 M msg/s     ║
║ LaserScan    │   1480 │          89 │      150 │  1.3992 │      0 │      1.46 M msg/s     ║
║ JointCommand │    928 │          80 │      130 │  1.9683 │      0 │      3.02 M msg/s     ║
╚══════════════════════════════════════════════════════════════════════════════════════════╝
Sustained rate is wall-clock over the measured loop, so it includes the batch
drain-waits. It is a publish rate for this producer/consumer pair, not a bus limit.

╔══════════════════════════════════════════════════════════════════╗
║              REAL-TIME SUITABILITY ANALYSIS                      ║
╠══════════════════════════════════════════════════════════════════╣
║ These gates grade the p99 of the send() ENQUEUE COST against one ║
║ whole control period. They are not end-to-end control-loop       ║
║ guarantees: a real loop also pays the receive side, the node's   ║
║ compute, and the scheduler's jitter, none of which is measured   ║
║ here. The headroom is printed so a pass by four orders of        ║
║ magnitude cannot be read as a tight result.                      ║
╠══════════════════════════════════════════════════════════════════╣
║ CmdVel    (1kHz  control): ~ PASS by 14493x — gate not discriminating (p99=69ns vs 1000000ns)
║ CmdVel    (10kHz control): ~ PASS by 1449x — gate not discriminating (p99=69ns vs 100000ns)
║ Imu       (500Hz fusion) : ~ PASS by 22472x — gate not discriminating (p99=89ns vs 2000000ns)
║ LaserScan (40Hz  lidar)  : ~ PASS by 166667x — gate not discriminating (p99=150ns vs 25000000ns)
║ JointCmd  (500Hz control): ~ PASS by 15385x — gate not discriminating (p99=130ns vs 2000000ns)
╚══════════════════════════════════════════════════════════════════╝

Results written to: /home/runner/work/horus/horus/benchmarks/gate-reports/robotics-2.json
===== repetition 3/3 =====

HORUS cross-process benchmark — ONE-WAY LATENCY (headline) + unpaced queue delay
Two OS processes on two distinct physical cores over the real Topic SHM transport.
Every handle holds exactly one role, so the `role == Both` same-thread fast path that
produces the repo's headline send-cost figure is never taken. Round-trip rows are
labelled where they are a halved round trip. See the module header for the clock
decomposition and for why the `Topic_cross_process` JSON key was retired.

MACHINE — every nanosecond below is conditional on this block
------------------------------------------------------------------------------------------------------------------------------------------
  cpu model              : AMD EPYC 7763 64-Core Processor (2 physical / 4 logical cores)
  kernel                 : 6.17.0-1022-azure (x86_64)
  benchmark cores        : cpu3 = process A (pinger / subscriber), cpu1 = process B (responder / publisher)  [DistinctPhysical]
  governor               : cpu3=n/a cpu1=n/a  driver=n/a
  scaling range          : n/a .. n/a  (hw max n/a)  turbo_disabled=unknown
  clocksource            : tsc   tsc flags: [tsc, rdtscp, constant_tsc, tsc_reliable, nonstop_tsc]
  TSC rate (calibrated)  : 2445.479 MHz (0.4089 ns/cycle) — a WALL clock; NOT the core clock
  clock instrumentation  : 49 cycles = 20.0 ns for serialize()+rdtsc()+rdtscp(), INCLUDED in every sample and never subtracted
  transparent_hugepage   : [always] madvise never
  sched_rt_runtime/period: 950000 / 1000000 us    perf_event_paranoid=4
  isolcpus=(none)  nohz_full=(none)  smt_active=1  mlockall(MCL_CURRENT)=true
------------------------------------------------------------------------------------------------------------------------------------------

running ping-pong (one-way latency), 64 B payload ...
running ping-pong (one-way latency), 1024 B payload ...
running paced stream (one-way latency), 64 B payload ...
running paced stream (one-way latency), 1024 B payload ...
running unpaced stream (QUEUE DELAY, not latency), 64 B payload ...

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! READ THIS BEFORE QUOTING ANY NUMBER BELOW
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!  CPU governor is ?/?, not `performance`. RDTSC is a wall clock while the work costs a fixed number of CORE cycles, so every nanosecond below scales with a frequency the governor is free to change. iceoryx2's maintainers measured ~300 ns of difference from the governor alone.
!!  No isolcpus= on the kernel command line: the benchmark cores are shared with everything else on this box. The involuntary context-switch count in each scenario block is the mechanism behind the far tail.
!!  pingpong (1024 B) `one-way, offset-free`: p99.99 rests on 99 observations. Below ~100 exceedances it is a max wearing a percentile's name; +/-5% needs ~400 (--iterations 4000000).
!!  paced_stream (64 B) `one-way (assumes TSC coherence)`: p99.99 rests on 20 observations. Below ~100 exceedances it is a max wearing a percentile's name; +/-5% needs ~400 (--iterations 4000000).
!!  paced_stream (1024 B) `one-way (assumes TSC coherence)`: p99.99 rests on 20 observations. Below ~100 exceedances it is a max wearing a percentile's name; +/-5% needs ~400 (--iterations 4000000).
!!  unpaced_queue (64 B): measured backlog is only 1.35 messages — the subscriber kept up, so the ring never filled and `Topic_cross_process_unpaced_queue_delay` is NOT a backpressure figure on this run. It is a publish-to-receive delay with no queueing in it, and it is still not a latency (see the paced and ping-pong rows for that).
!!  unpaced_queue (64 B) `publish->receive incl. queue`: p99.99 rests on 20 observations. Below ~100 exceedances it is a max wearing a percentile's name; +/-5% needs ~400 (--iterations 4000000).
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

== cross-process ping-pong -- ONE-WAY LATENCY (2 processes, 2 topics, 1 role per handle) ==
   json metric key: `Topic_cross_process_oneway_pingpong` (identity used by the CI gate: `Topic_cross_process_oneway_pingpong@64B`)
   payload Probe64 = 64 B (POD=true) | ring capacity 256 slots | topology 1P/1C | cpu3 <-> cpu1 | pid 6305 <-> pid 6313
------------------------------------------------------------------------------------------------------------------------------------------
  metric (ns)                            n       min    median       p99     p99.9     p99.99         max |  n>p99.9  n>p99.99
------------------------------------------------------------------------------------------------------------------------------------------
  one-way, offset-free             1000000     110.0     150.1     195.1     711.1     7448.4     16089.3 |      979       100
  round trip (RTT)                 1000000     260.5     330.8     420.8    1462.7    15398.2     39693.2 |      983       100
  RTT halved (one-way)             1000000     130.2     165.4     210.4     731.3     7699.1     19846.6 |      983       100
  leg A->B (apparent)              1000000     110.0     150.1     200.4    1122.1    10158.7     31998.6 |      981       100
  leg B->A (apparent)              1000000     110.4     150.5     220.4     290.7     8485.9     29384.4 |      996       100
  responder turnaround             1000000      29.9      30.3      40.1      40.1      160.3     39332.6 |      602        97
------------------------------------------------------------------------------------------------------------------------------------------
  samples=1000000  warmup=200000  transferred=2000000  lost=0  invalid(TSC-skew)=0  poll cost=12.7 ns  window=0.396 s
  measured window: minor_faults=0 major_faults=0 ctx_switches vol=78 invol=6
  core freq cpu3   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  core freq cpu1   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  cross-core TSC offset theta_hat = -0.2 ns (clock B - clock A). The `one-way, offset-free` row does not depend on it.

== cross-process ping-pong -- ONE-WAY LATENCY (2 processes, 2 topics, 1 role per handle) ==
   json metric key: `Topic_cross_process_oneway_pingpong` (identity used by the CI gate: `Topic_cross_process_oneway_pingpong@1024B`)
   payload Probe1k = 1024 B (POD=true) | ring capacity 256 slots | topology 1P/1C | cpu3 <-> cpu1 | pid 6305 <-> pid 6316
------------------------------------------------------------------------------------------------------------------------------------------
  metric (ns)                            n       min    median       p99     p99.9     p99.99         max |  n>p99.9  n>p99.99
------------------------------------------------------------------------------------------------------------------------------------------
  one-way, offset-free             1000000     195.5     280.5     410.6    1272.1    10203.7     18709.2 |     1000        99
  round trip (RTT)                 1000000     430.6     591.3     851.8    2685.0    20638.1     37449.1 |      999       100
  RTT halved (one-way)             1000000     215.3     295.6     425.9    1342.5    10319.0     18724.6 |      999       100
  leg A->B (apparent)              1000000     179.9     270.3     440.8     711.1    19245.3     37138.3 |     1000       100
  leg B->A (apparent)              1000000     180.3     280.5     451.0     661.6     9317.6     23944.6 |      986        99
  responder turnaround             1000000      29.9      30.3      40.1      40.1      170.5     32199.4 |      872        98
------------------------------------------------------------------------------------------------------------------------------------------
  samples=1000000  warmup=200000  transferred=2000000  lost=0  invalid(TSC-skew)=0  poll cost=32.7 ns  window=0.688 s
  measured window: minor_faults=0 major_faults=0 ctx_switches vol=135 invol=1
  core freq cpu3   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  core freq cpu1   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  cross-core TSC offset theta_hat = -5.1 ns (clock B - clock A). The `one-way, offset-free` row does not depend on it.

== cross-process paced stream -- ONE-WAY LATENCY (10000 ns publish period, publisher -> subscriber, direct) ==
   json metric key: `Topic_cross_process_oneway_paced_stream` (identity used by the CI gate: `Topic_cross_process_oneway_paced_stream@64B`)
   payload Probe64 = 64 B (POD=true) | ring capacity 256 slots | topology 1P/1C | cpu3 <-> cpu1 | pid 6305 <-> pid 6318
------------------------------------------------------------------------------------------------------------------------------------------
  metric (ns)                            n       min    median       p99     p99.9     p99.99         max |  n>p99.9  n>p99.99
------------------------------------------------------------------------------------------------------------------------------------------
  one-way (assumes TSC coherence)    200000     110.4     170.5     451.0    5841.0    17262.1     45814.7 |      200        20
------------------------------------------------------------------------------------------------------------------------------------------
  samples=200000  warmup=20000  transferred=200000  lost=0  invalid(TSC-skew)=0  poll cost=8.6 ns  window=2.000 s
  measured backlog: 0.02 messages deep on the median sample (ring holds 256); delivered 100.0% of transferred
  measured window: minor_faults=0 major_faults=0 ctx_switches vol=394 invol=12
  core freq cpu3   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  core freq cpu1   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  this row assumes cross-core TSC coherence; theta_hat measured in the ping-pong at this size = -0.2 ns (add to correct).

== cross-process paced stream -- ONE-WAY LATENCY (10000 ns publish period, publisher -> subscriber, direct) ==
   json metric key: `Topic_cross_process_oneway_paced_stream` (identity used by the CI gate: `Topic_cross_process_oneway_paced_stream@1024B`)
   payload Probe1k = 1024 B (POD=true) | ring capacity 256 slots | topology 1P/1C | cpu3 <-> cpu1 | pid 6305 <-> pid 6320
------------------------------------------------------------------------------------------------------------------------------------------
  metric (ns)                            n       min    median       p99     p99.9     p99.99         max |  n>p99.9  n>p99.99
------------------------------------------------------------------------------------------------------------------------------------------
  one-way (assumes TSC coherence)    200000     200.4     260.9     541.4    2334.5    11431.3     37960.3 |      197        20
------------------------------------------------------------------------------------------------------------------------------------------
  samples=200000  warmup=20000  transferred=200000  lost=0  invalid(TSC-skew)=0  poll cost=20.4 ns  window=2.000 s
  measured backlog: 0.03 messages deep on the median sample (ring holds 256); delivered 100.0% of transferred
  measured window: minor_faults=0 major_faults=0 ctx_switches vol=393 invol=12
  core freq cpu3   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  core freq cpu1   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  this row assumes cross-core TSC coherence; theta_hat measured in the ping-pong at this size = -5.1 ns (add to correct).

== cross-process unpaced stream -- QUEUE DELAY / BACKPRESSURE, NOT LATENCY (publisher unthrottled; each sample includes its wait in the ring) ==
   !! Every number in this block is a PUBLISH-TO-RECEIVE DELAY that INCLUDES
   !! time spent waiting in the ring. It is a backpressure/throughput figure.
   !! Do not quote it as an IPC latency; that is the exact mistake the retired
   !! `Topic_cross_process` metric shipped for months. Read `measured backlog`
   !! below: ~1 message means the subscriber kept up and no queue formed.
   json metric key: `Topic_cross_process_unpaced_queue_delay` (identity used by the CI gate: `Topic_cross_process_unpaced_queue_delay@64B`)
   payload Probe64 = 64 B (POD=true) | ring capacity 256 slots | topology 1P/1C | cpu3 <-> cpu1 | pid 6305 <-> pid 6322
------------------------------------------------------------------------------------------------------------------------------------------
  metric (ns)                            n       min    median       p99     p99.9     p99.99         max |  n>p99.9  n>p99.99
------------------------------------------------------------------------------------------------------------------------------------------
  publish->receive incl. queue      200000     100.2     150.5     240.9    1012.1     8445.8     43690.8 |      199        20
------------------------------------------------------------------------------------------------------------------------------------------
  samples=200000  warmup=20000  transferred=200000  lost=0  invalid(TSC-skew)=0  poll cost=24.5 ns  window=0.022 s
  measured backlog: 1.35 messages deep on the median sample (ring holds 256); delivered 100.0% of transferred
  measured window: minor_faults=0 major_faults=0 ctx_switches vol=4 invol=0
  core freq cpu3   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  core freq cpu1   (measured window only): start=n/a end=n/a min=0MHz max=0MHz mean=0MHz spread=0.00% (n=0)
  this row assumes cross-core TSC coherence; theta_hat measured in the ping-pong at this size = -0.2 ns (add to correct).

SUMMARY — one row per published JSON metric (nanoseconds, wall clock)
------------------------------------------------------------------------------------------------------------------------------------------
  json metric key                                what it measures                  n    median       p99     p99.9     p99.99         max
------------------------------------------------------------------------------------------------------------------------------------------
  Topic_cross_process_oneway_pingpong@64B        ONE-WAY latency             1000000     150.1     195.1     711.1     7448.4     16089.3
  Topic_cross_process_oneway_pingpong@1024B      ONE-WAY latency             1000000     280.5     410.6    1272.1    10203.7     18709.2
  Topic_cross_process_oneway_paced_stream@64B    ONE-WAY latency              200000     170.5     451.0    5841.0    17262.1     45814.7
  Topic_cross_process_oneway_paced_stream@1024B  ONE-WAY latency              200000     260.9     541.4    2334.5    11431.3     37960.3
  Topic_cross_process_unpaced_queue_delay@64B    QUEUE DELAY (not latency)    200000     150.5     240.9    1012.1     8445.8     43690.8
------------------------------------------------------------------------------------------------------------------------------------------
  Instrumentation is INCLUDED in every figure and never subtracted.
  `Topic_cross_process_oneway_pingpong` is the true one-way figure: it assumes
  nothing about cross-core TSC synchronisation and excludes the responder's turnaround.
  `RTT halved (one-way)` in the per-scenario tables is a ROUND TRIP DIVIDED BY TWO; it is
  the row to compare against any competitor publishing a halved ping-pong.
  `Topic_cross_process_unpaced_queue_delay` is a BACKPRESSURE figure: it includes
  however long the message waited in the ring, so it scales with the achieved backlog
  (printed in its scenario block) and is NOT a latency.
  A figure without its payload size, ring depth and topology is not comparable to anything.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! THE SAME WARNINGS AGAIN — they apply to every number above
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!  CPU governor is ?/?, not `performance`. RDTSC is a wall clock while the work costs a fixed number of CORE cycles, so every nanosecond below scales with a frequency the governor is free to change. iceoryx2's maintainers measured ~300 ns of difference from the governor alone.
!!  No isolcpus= on the kernel command line: the benchmark cores are shared with everything else on this box. The involuntary context-switch count in each scenario block is the mechanism behind the far tail.
!!  pingpong (1024 B) `one-way, offset-free`: p99.99 rests on 99 observations. Below ~100 exceedances it is a max wearing a percentile's name; +/-5% needs ~400 (--iterations 4000000).
!!  paced_stream (64 B) `one-way (assumes TSC coherence)`: p99.99 rests on 20 observations. Below ~100 exceedances it is a max wearing a percentile's name; +/-5% needs ~400 (--iterations 4000000).
!!  paced_stream (1024 B) `one-way (assumes TSC coherence)`: p99.99 rests on 20 observations. Below ~100 exceedances it is a max wearing a percentile's name; +/-5% needs ~400 (--iterations 4000000).
!!  unpaced_queue (64 B): measured backlog is only 1.35 messages — the subscriber kept up, so the ring never filled and `Topic_cross_process_unpaced_queue_delay` is NOT a backpressure figure on this run. It is a publish-to-receive delay with no queueing in it, and it is still not a latency (see the paced and ping-pong rows for that).
!!  unpaced_queue (64 B) `publish->receive incl. queue`: p99.99 rests on 20 observations. Below ~100 exceedances it is a max wearing a percentile's name; +/-5% needs ~400 (--iterations 4000000).
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Gate report written to /home/runner/work/horus/horus/benchmarks/gate-reports/cross_process-3.json
  keys: Topic_cross_process_oneway_pingpong@64B, Topic_cross_process_oneway_pingpong@1024B, Topic_cross_process_oneway_paced_stream@64B, Topic_cross_process_oneway_paced_stream@1024B, Topic_cross_process_unpaced_queue_delay@64B
  NOTE: `Topic_cross_process` is retired. A baseline window that still holds it
  will report it as missing and fail the gate until the window is refreshed —
  that is intended, and is why the key was not silently reused.
  Raw samples are omitted (pass --raw-in-json, or --raw-dir for a lossless cycle dump).
  7 warning(s) apply to these numbers and are NOT in this file; use --detail-json.
╔══════════════════════════════════════════════════════════════════╗
║        HORUS Robotics Message Types Benchmark                    ║
╠══════════════════════════════════════════════════════════════════╣
║  Testing real-world robotics message latency (REP 2014)          ║
╚══════════════════════════════════════════════════════════════════╝

Platform: AMD EPYC 7763 64-Core Processor (4 cores)
Iterations: 50000
Warmup: 5000

╔═════════════════════════════════════════════════════════════════════════════╗
║ Message Type    │ Size (bytes) │ Typical Rate │ Use Case                    ║
╠═════════════════════════════════════════════════════════════════════════════╣
║ CmdVel          │           16 │ 1000+ Hz     │ Velocity control commands   ║
║ Imu             │          296 │ 500+ Hz      │ IMU sensor fusion           ║
║ LaserScan       │         1480 │ 10-40 Hz     │ 2D lidar navigation         ║
║ JointCommand    │         1032 │ 500+ Hz      │ Manipulator control         ║
╚═════════════════════════════════════════════════════════════════════════════╝


[Topic] Running benchmarks — timing tx.send() enqueue cost only
        (cross-thread consumer drains in the background; no sample
         waits for delivery, so these are NOT end-to-end latencies)
─────────────────────────────────────────────────
  CmdVel              16 bytes │ median:      40ns │ p99:      69ns │ CV: 0.3120
  Imu                304 bytes │ median:      40ns │ p99:      89ns │ CV: 2.1932
  LaserScan         1480 bytes │ median:      89ns │ p99:     150ns │ CV: 1.3876
  JointCommand       928 bytes │ median:      80ns │ p99:     130ns │ CV: 0.9481

╔══════════════════════════════════════════════════════════════════════════════════════════╗
║           SUMMARY BY MESSAGE TYPE — send() ENQUEUE COST, not end-to-end latency           ║
╠══════════════════════════════════════════════════════════════════════════════════════════╣
║ Message      │   Size │ Median (ns) │ p99 (ns) │    CV   │ Misses │ Sustained rate       ║
╠══════════════════════════════════════════════════════════════════════════════════════════╣
║ CmdVel       │     16 │          40 │       69 │  0.3120 │      0 │      5.90 M msg/s     ║
║ Imu          │    304 │          40 │       89 │  2.1932 │      0 │      3.72 M msg/s     ║
║ LaserScan    │   1480 │          89 │      150 │  1.3876 │      0 │      1.45 M msg/s     ║
║ JointCommand │    928 │          80 │      130 │  0.9481 │      0 │      3.02 M msg/s     ║
╚══════════════════════════════════════════════════════════════════════════════════════════╝
Sustained rate is wall-clock over the measured loop, so it includes the batch
drain-waits. It is a publish rate for this producer/consumer pair, not a bus limit.

╔══════════════════════════════════════════════════════════════════╗
║              REAL-TIME SUITABILITY ANALYSIS                      ║
╠══════════════════════════════════════════════════════════════════╣
║ These gates grade the p99 of the send() ENQUEUE COST against one ║
║ whole control period. They are not end-to-end control-loop       ║
║ guarantees: a real loop also pays the receive side, the node's   ║
║ compute, and the scheduler's jitter, none of which is measured   ║
║ here. The headroom is printed so a pass by four orders of        ║
║ magnitude cannot be read as a tight result.                      ║
╠══════════════════════════════════════════════════════════════════╣
║ CmdVel    (1kHz  control): ~ PASS by 14493x — gate not discriminating (p99=69ns vs 1000000ns)
║ CmdVel    (10kHz control): ~ PASS by 1449x — gate not discriminating (p99=69ns vs 100000ns)
║ Imu       (500Hz fusion) : ~ PASS by 22472x — gate not discriminating (p99=89ns vs 2000000ns)
║ LaserScan (40Hz  lidar)  : ~ PASS by 166667x — gate not discriminating (p99=150ns vs 25000000ns)
║ JointCmd  (500Hz control): ~ PASS by 15385x — gate not discriminating (p99=130ns vs 2000000ns)
╚══════════════════════════════════════════════════════════════════╝

Results written to: /home/runner/work/horus/horus/benchmarks/gate-reports/robotics-3.json


Gated against a rolling window of recent main runs. Each metric's band is max(relative, center + k·sigma_observed, absolute floor), so it is derived from the noise the baseline itself measured — where a band is printed wider than the change you care about, this run did not detect a regression and could not have. Thresholds and their reasoning: RegressionPolicy in benchmarks/src/output.rs.
Commit: 7ac38d4

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The folded changes are narrow, consistent with existing safety patterns (checked SHM geometry, single-source path mappings), and include targeted regression tests for the previously-missed cases.

Pull request overview

This PR folds the net changes from #200/#201/#202 onto main to avoid multiple strict-CI cycles, combining SHM-layout hardening, cargo workspace generator correctness, and registry installer detection fixes.

Changes:

  • Centralize .meta sidecar path derivation in horus_sys::shm::topic_meta_path and use it from the manager’s stale-topic reaper, with coverage for legal topic name characters.
  • Fix the workspace Cargo generator to emit requested horus dependency features (via the shared write_horus_path_deps), and add a regression test on emitted TOML.
  • Fix HORUS-package detection in the registry installer helpers by using error_wrapper::FIRST_PARTY_CRATES (via is_first_party_crate) and add a regression test covering horus = "…".
File summaries
File Description
horus_sys/src/shm/mod.rs Adds topic_meta_path as the single .meta sidecar mapping and tests covering sanitization and directory placement.
horus_manager/src/discovery/topics.rs Uses horus_sys::shm::topic_meta_path when reaping stale topics to avoid path-mapping drift.
horus_manager/src/cargo_gen.rs Uses shared write_horus_path_deps in workspace generation so requested features are not dropped; adds a regression test on emitted TOML.
horus_manager/src/registry/helpers.rs Detects first-party dependencies via is_first_party_crate instead of a stale hardcoded subset; adds a regression test including the horus facade crate.
horus_core/src/communication/topic/header.rs Replaces hand-restated SHM layout arithmetic and panicking slices with checked layout helpers and bounds-safe .get(..)? reads.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@starswallow
starswallow merged commit e641582 into main Sep 6, 2026
78 checks passed
@starswallow
starswallow deleted the integration/duplication-batches branch September 6, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants