fix(ci): address PR #35 review comments
- Document non-blocking receive contract in perf_bench.rs docstring, confirming no TCP deadlock race (Hoshe #1, critical) - Make shadowcast parser order-independent — flush on new config header instead of requiring Recursive after Symmetric (Hoshe #2) - Fix p95 calculation: use floor(0.95*(N-1)) nearest-rank instead of ceil(0.95*N)-1 which was off-by-one at N=50 (Hoshe #4) - Error on --compare when no baseline file exists (Hoshe #5) - Add D-031 10tps assumption comment to TICK_BUDGET_US (Tyre #1) - Strengthen snapshot assertion: require warmup + half measurement window instead of warmup + 1 (Tyre #2) - Regenerate baseline with corrected p95 (356µs, was 526µs) Hoshe #3 (.PHONY) was already addressed — perf-baseline is in the .PHONY declaration on Makefile line 10. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+13
-4
@@ -22,7 +22,8 @@ ROOT = Path(__file__).resolve().parent.parent
|
||||
PERF_DIR = ROOT / "tests" / "perf"
|
||||
BASELINE_FILE = PERF_DIR / "baseline.json"
|
||||
|
||||
# Tick budget from D-026
|
||||
# Tick budget from D-026: 100ms per tick at 10 tps floor (D-031).
|
||||
# If tick rate changes, update this constant.
|
||||
TICK_BUDGET_US = 100_000 # 100ms
|
||||
|
||||
|
||||
@@ -95,6 +96,9 @@ def run_shadowcast_benchmark():
|
||||
line,
|
||||
)
|
||||
if m:
|
||||
# New config block — flush previous if complete
|
||||
if current.get("map_size"):
|
||||
configs.append(current)
|
||||
current = {
|
||||
"map_size": int(m.group(1)),
|
||||
"density": m.group(3),
|
||||
@@ -113,11 +117,12 @@ def run_shadowcast_benchmark():
|
||||
if m:
|
||||
current["recursive_total_ms"] = float(m.group(1))
|
||||
current["recursive_per_call_us"] = float(m.group(2))
|
||||
if current.get("map_size"):
|
||||
configs.append(current)
|
||||
current = {}
|
||||
continue
|
||||
|
||||
# Flush last config
|
||||
if current.get("map_size"):
|
||||
configs.append(current)
|
||||
|
||||
return {"configs": configs} if configs else None
|
||||
|
||||
|
||||
@@ -252,6 +257,10 @@ def main():
|
||||
if compare_mode and regressions:
|
||||
print(f"\n{len(regressions)} regression(s) detected.")
|
||||
return 1
|
||||
elif compare_mode:
|
||||
print(f"\nERROR: --compare requires a saved baseline at {BASELINE_FILE.relative_to(ROOT)}")
|
||||
print("Run `make perf-baseline` first to create one.")
|
||||
return 1
|
||||
|
||||
if compare_mode:
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user