Skip to content

tests: true-baseline helper-parity gate must not pass on empty==empty (#767) - #1182

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/767-helper-parity-gate
Oct 23, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/767-helper-parity-gate

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Fixes #767

Summary

  • The issue's core ask — one helper implementation for both true-baseline sides — already landed on master in a5980def (support/{recho,zecho}.c is THE implementation; the PE port is required-byte-exact; both carriers rebuilt from source every run). Verified end-to-end on this machine: fresh gcc/rustc builds of both carriers, the gate's own producer paths (GNU printf → ELF; rubash printf → PE spawned by rubash), 24/26 byte-identical including x\x80y, \xfe\xff, \xc3, \xe4\xb8 — the U+FFFD-vs-raw divergence is gone. The only 2 diffs are caf\xc3\xa9, the gate's own documented report-only tier (engine byte-reencoding family, never charged to the helpers).
  • What remained open is the hole demonstrated in the issue thread: the gate's equality test cannot tell "identical" from "both empty", so a broken helper/spawn path reports an all-green matrix that compared nothing. Reproduced against the real pre-change script by putting a no-output od first on PATH: helper-parity: gate green (26 ok, 0 report-only) — while comparing literally nothing.
  • .parity.sh ends every invocation with a literal tail-arg operand, so a valid dump MUST contain its bytes (hex 7461696c2d617267). The gate now asserts that sentinel in both dumps — whitespace-stripped since od -tx1 wraps — before any equality test, and FAILs (exit 9) when it is absent. One check covers empty capture, command not found, and spawn failures — the two assertions requested in the issue thread.

Test plan

  • Real path green: scripts/true-baseline.sh nosuchsuite on a fresh master arm build → helper-parity: gate green (24 ok, 2 report-only); the 2 INFO lines are caf\xc3\xa9 on recho+zecho, the documented report-only tier
  • Regression (fails before, caught after): stubbed od (emits nothing, delegates -N calls for is_elf) → old script prints gate green (26 ok) rc=0; new script prints 26 FAIL ... (tail-arg sentinel missing; empty==empty is a false pass) → FATAL exit 9
  • bash -n clean; no Rust changes (cargo fmt not applicable)

Generated with Devin

a5980de unified the two helper carriers behind one implementation and
gated the ledger on byte-identical od dumps, but the gate's equality
test cannot tell "identical" from "both empty": a broken helper or
spawn path produces two empty dumps that compare equal, and the #767
thread measured exactly that -- an all-green matrix that compared
nothing. Reproduced here against the real pre-change script by putting
a no-output od first on PATH: "helper-parity: gate green (26 ok)".

.parity.sh ends every invocation with a literal tail-arg operand, so a
valid dump MUST contain its bytes (hex 7461696c2d617267). The gate now
asserts that sentinel in BOTH dumps -- whitespace-stripped, since
od -tx1 wraps -- before any equality test, and FAILs (exit 9) when it
is absent. This covers empty capture, "command not found", and spawn
failures in one check, per the two assertions requested in the issue
thread.

Verified: real path green (24 ok, 2 report-only caf\xc3\xa9 INFO, both
carriers rebuilt from source, arm = fresh master build); stubbed-od
path now exits 9 on all 26 cases where it previously printed green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant