[PR #1985] [MERGED] parity: clear rust-<name>-parity outputs after a pass (−63 GB per checkout), reuse oracles on CI #3914

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

📋 Pull Request Information

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

Base: main ← Head: perf/parity-disk


📝 Commits (1)

  • 5034e45 parity: clear rust--parity outputs after a pass, reuse oracles on CI

📊 Changes

6 files changed (+47 additions, -7 deletions)

View changed files

📝 .github/workflows/parity.yml (+10 -1)
📝 tests/test_parity_runner.py (+14 -0)
📝 tools/parity.py (+14 -6)
📝 tools/test_collision_parity.py (+3 -0)
📝 tools/test_geometry_parity.py (+3 -0)
📝 tools/test_world_parity.py (+3 -0)

📄 Description

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

What

Harness outputs were filling the Mac mini's disk (14 GB free last night). Three causes:

  1. clear_large_outputs missed most harness folders. After a pass, parity.py deletes large outputs only in .local folders whose name starts with the harness's name. 174 harnesses write to .local/rust-<name>-parity, so nothing was cleared there. It now also clears rust-<name>-parity, and strips the shard suffix (datafix#2).
  2. Huge vanilla outputs were kept for oracle reuse. They are now kept only up to 256 MB (KEPT_ORACLE_OUTPUT). Larger ones are deleted like the Rust dumps, and their 12 harnesses rerun their oracle.
  3. One run folder per run. collision, world and geometry mkdtemp a run-* folder per run and never removed it. Each run now removes the earlier ones.

Also, oracle reuse never worked on CI. Harnesses inherited the runner's stdin, which is a pipe on GitHub's runner. parity_shim.py never caches an oracle run whose stdin is a pipe, and the runner's oracle-cache held no record since 2026-10-21, while its hashes.sqlite-shm changed on every run. Harnesses now start with stdin from /dev/null.

Guard (orchestrator's request): in parity.yml, if the number of names read from main's --list differs from its "N of M harnesses would run" line, the head's own selection runs instead of passing untested.

Before / after

Disk, .local/rust-*-parity in the Mac mini's first runner checkout (the second is the same size, 91 GB):

GB
Total today 86.6
Rust outputs ≥ 64 MB (now cleared after a pass) 23.2
Fixture inputs ≥ 64 MB (cleared, rewritten each run) 2.9
Vanilla outputs > 256 MB (cleared, 12 harnesses) 26.3
Vanilla outputs 64-256 MB (kept, for oracle reuse) 6.1
Leftover run-* folders (collision 5.2, geometry 3.6, world 2.2) 11.1 → ~0.5
Left after the next pass of each ~24 (−63 GB per checkout)

The worst folders: state_provider 13.0 GB, attribute_map_queries 12.4, stored_effect_notifications 7.9, collision 5.3, live_attributes 4.1, geometry 3.7, block_survival 3.1. Agent worktrees fill the same way (one perf worktree reached 91 GB, ~40 GB of it here).

Time, Mac mini, stdin a pipe as on CI, --repeat 3:

Harness Old code (no reuse) New code (1st run, then reused oracle)
tooltip_display 31 s, 25 s 15 s, 2 s, 2 s
block_update 39 s, 48 s, 51 s 49 s, 13 s, 12 s

Self-check

  • python3 -m unittest tests.test_parity_runner.LargeOutputTests: OK. The new test covers a rust-<name>-parity folder, a shard name, a kept 16 B oracle output and a cleared 64 B one at a 32 B cap.
  • parity.yml parses. The count guard was checked on four summaries (match, zero, mismatch, unknown format).
  • The three harness scripts change, so CI reruns collision, world and geometry once.

🤖 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/1985 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `perf/parity-disk` --- ### 📝 Commits (1) - [`5034e45`](https://github.com/horizon-rust/horizon/commit/5034e4557dba8c54ebd406a50ef4449b8d7ec2ea) parity: clear rust-<name>-parity outputs after a pass, reuse oracles on CI ### 📊 Changes **6 files changed** (+47 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/parity.yml` (+10 -1) 📝 `tests/test_parity_runner.py` (+14 -0) 📝 `tools/parity.py` (+14 -6) 📝 `tools/test_collision_parity.py` (+3 -0) 📝 `tools/test_geometry_parity.py` (+3 -0) 📝 `tools/test_world_parity.py` (+3 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Harness outputs were filling the Mac mini's disk (14 GB free last night). Three causes: 1. **`clear_large_outputs` missed most harness folders.** After a pass, `parity.py` deletes large outputs only in `.local` folders whose name starts with the harness's name. 174 harnesses write to `.local/rust-<name>-parity`, so nothing was cleared there. It now also clears `rust-<name>-parity`, and strips the shard suffix (`datafix#2`). 2. **Huge vanilla outputs were kept for oracle reuse.** They are now kept only up to 256 MB (`KEPT_ORACLE_OUTPUT`). Larger ones are deleted like the Rust dumps, and their 12 harnesses rerun their oracle. 3. **One run folder per run.** `collision`, `world` and `geometry` `mkdtemp` a `run-*` folder per run and never removed it. Each run now removes the earlier ones. Also, **oracle reuse never worked on CI.** Harnesses inherited the runner's stdin, which is a pipe on GitHub's runner. `parity_shim.py` never caches an oracle run whose stdin is a pipe, and the runner's `oracle-cache` held no record since 2026-10-21, while its `hashes.sqlite-shm` changed on every run. Harnesses now start with stdin from `/dev/null`. **Guard (orchestrator's request):** in `parity.yml`, if the number of names read from main's `--list` differs from its "N of M harnesses would run" line, the head's own selection runs instead of passing untested. ## Before / after **Disk**, `.local/rust-*-parity` in the Mac mini's first runner checkout (the second is the same size, 91 GB): | | GB | | --- | --- | | Total today | 86.6 | | Rust outputs ≥ 64 MB (now cleared after a pass) | 23.2 | | Fixture inputs ≥ 64 MB (cleared, rewritten each run) | 2.9 | | Vanilla outputs > 256 MB (cleared, 12 harnesses) | 26.3 | | Vanilla outputs 64-256 MB (kept, for oracle reuse) | 6.1 | | Leftover `run-*` folders (collision 5.2, geometry 3.6, world 2.2) | 11.1 → ~0.5 | | **Left after the next pass of each** | **~24** (−63 GB per checkout) | The worst folders: state_provider 13.0 GB, attribute_map_queries 12.4, stored_effect_notifications 7.9, collision 5.3, live_attributes 4.1, geometry 3.7, block_survival 3.1. Agent worktrees fill the same way (one perf worktree reached 91 GB, ~40 GB of it here). **Time**, Mac mini, stdin a pipe as on CI, `--repeat 3`: | Harness | Old code (no reuse) | New code (1st run, then reused oracle) | | --- | --- | --- | | tooltip_display | 31 s, 25 s | 15 s, 2 s, 2 s | | block_update | 39 s, 48 s, 51 s | 49 s, 13 s, 12 s | ## Self-check - `python3 -m unittest tests.test_parity_runner.LargeOutputTests`: OK. The new test covers a `rust-<name>-parity` folder, a shard name, a kept 16 B oracle output and a cleared 64 B one at a 32 B cap. - `parity.yml` parses. The count guard was checked on four summaries (match, zero, mismatch, unknown format). - The three harness scripts change, so CI reruns collision, world and geometry once. 🤖 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:13:13 +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#3914
No description provided.