Repository navigation
Description
What's the problem
Why
The live harness normally expects about two workers. That proves the basic contract but not worker aggregation, proxy routing, or dashboard totals when the worker set grows.
what it impacts
Impact is not separately established in the existing report; confirm the affected users or behavior.
How I found it
Discovery details are not separately established in the existing report; preserve and verify the evidence already recorded.
how important is it
Importance has not been assessed explicitly; triage must state the priority and its reason.
acceptance criteria
Done when
- Add one lightweight load-generator worker without introducing a new test framework.
- Run alongside the real bench workers through xmrig-proxy.
- Assert every worker is distinct and visible, aggregate hashrate is plausible, and accepted-share counters advance.
- Exercise one route/failover transition and prove all workers recover.
- Record CPU/memory and response-time ceilings as evidence, not hard-coded product limits unless measured.
- Tear down the generated worker and restore the baseline.
Follow-up to the real-worker legs retained by #209.
Acceptance script
This script operationalizes the "Done when" list above and the operator rulings in the comments: gate on baseline plus one distinct worker label, a positive aggregate, advancing accepted shares, and one failover transition with every worker recovered. CPU, RSS and dashboard latency are recorded, not gated. Done means the script at the end of this section prints ACCEPTED and exits 0 on the PR head, given the evidence of one tier4-e2e job on that same head. Every check is a mechanical pass or fail, so no judgment call is needed. Paste the script's full output into the PR body.
# save the script below as /tmp/accept_1999.py (outside the repo)
# 1. on the PR head, submit one tier4-e2e job with a borrowed rig and the load-worker opt-in
# (`workers: 3` per the ruling)
# 2. when it finishes, collect its evidence into one directory:
J='<job id>@<full head SHA>'; D=/tmp/accept-1999-evidence; mkdir -p "$D"
bench-ci status "$J" --json > "$D/job.json"
bench-ci artifacts "$J" | awk '{print $NF}' | while read -r p; do
mkdir -p "$D/$(dirname "$p")" && bench-ci artifacts "$J" "$p" --out "$D/$p"; done
# 3. from the repo root, on the same head:
python3 /tmp/accept_1999.py --results "$D"
The script takes a few seconds and changes no file. Without --results, every B check prints FAIL with bench evidence not supplied. The B checks read job.json plus exactly one manifest.txt and one multi-worker-metrics.json under the directory. bench-ci serves the harness's results/ files under results/.
The leg writes results/multi-worker-metrics.json, one JSON object with at least these fields. Draft PR #2175 already writes all but the two marked new.
| Field | Meaning |
|---|---|
load_worker |
the temporary clone's worker label |
baseline_workers (new) |
the online labels recorded before the clone started |
saw_ready, saw_failover, saw_recovery |
1 once every baseline label plus the clone was online; once the proxy was stopped after that; once the full set was back after the stop |
aggregate_hashrate_hs |
the peak observed aggregate rate of the online workers |
accepted_before (new), accepted |
aggregate accepted shares when the clone started, and the peak observed during the leg |
peak_cpu_pct, peak_rss_kib, dashboard_latency_s, process_sampled |
recorded evidence; a number or null, and process_sampled 0 or 1 |
| Check | Passes when |
|---|---|
| C1 | Something under tests/integration/ differs from develop, and nothing outside tests/integration/, docs/, tests/inventory.sh and CHANGELOG.md does. |
| C2 | Every file added under tests/ ends in .sh: no new test framework. |
| C3 | tests/integration/e2e.sh still contains the line WORKERS=1 exactly once: workers: 1 stays the default. |
| B1 | job.json is repo pithead, tier tier4-e2e, commit equal to the checked-out head, options.no_rig not set and options.mode not check. |
| B2 | The job's conclusion is success and no row failed: bench-ci verified the bench and the borrowed rig back at baseline. |
| B3 | The harness manifest's git_rev is a prefix (7+ characters) of the head. |
| B4 | baseline_workers lists at least one distinct, non-empty label, load_worker is non-empty and not among them, and saw_ready is 1. |
| B5 | The manifest's expected_workers equals the baseline count plus one, never a fixed three, and the harness row workers online (>= <that number>) passed and never failed. |
| B6 | aggregate_hashrate_hs is a finite number above 0. |
| B7 | accepted is an integer greater than accepted_before. |
| B8 | saw_failover and saw_recovery are both 1. |
| B9 | peak_cpu_pct, peak_rss_kib and dashboard_latency_s are present as numbers or null, and process_sampled is 0 or 1. No value is gated. |
Rules:
- Do not change the script's test IDs, anchors or expected outcomes. If a check prints
error(anchor found 0x ...), production code has moved since this issue was filed. Stop and comment here with the output instead of editing the anchor. - A reviewer re-runs the same script on the head they review, with that head's job evidence. A changed head needs a fresh job and a fresh run.
- The repo's normal gates still apply on top of this:
make testand the adversarial review.
Baseline, run 2026-10-03 on 3822294: unmodified develop prints NOT ACCEPTED: 2/12 checks pass (C2 and C3), and NOT ACCEPTED: 6/12 checks pass with a synthetic failing job whose metrics file has the field set PR #2175 writes today. The pass side was validated with fixtures. A throwaway partial prototype, not committed, satisfied C1 to C3: PR #2175's lib/load-worker.sh with the two new fields, plus its tests/inventory.sh line, not wired into e2e.sh. With it, a synthetic passing job printed ACCEPTED: 12/12 checks pass. That job's metrics file was written by the prototype's own verify_load_worker, and its rows were parsed with bench-ci's row regex from a transcript printed by lib.sh. C1 to C3 are guards, not proof of the leg; the B checks carry the proof. No bench job ran.
Hint, not binding: bench-ci's catalogue now reads workers as the number of rigs to borrow (rigs_wanted). The ruling's workers: 3 opt-in for a one-rig clone may therefore need checking against the current runner before the job is submitted. The script does not pin options.workers. Follow-up #2173 already holds the ceiling question.
Independent re-check, 2026-10-03: a second session re-ran this script in a fresh worktree at 3822294. Develop printed NOT ACCEPTED: 6/12 checks pass, and with the pass fixtures it printed ACCEPTED: 12/12 checks pass. Files the script mutates were left unchanged after each run.
accept_1999.py
"""Acceptance check for p2pool-starter-stack/pithead#1999.
Save this file OUTSIDE the repo (for example /tmp/accept_1999.py) so it is never committed.
Run from the repo root on the PR head:
python3 /tmp/accept_1999.py --results DIR
DIR holds the tier4-e2e job's evidence (see the issue): job.json from
`bench-ci status <id>@<head> --json`, plus the job's downloaded artifacts, among them
manifest.txt and multi-worker-metrics.json. Without --results every bench check (B*) fails.
Prints PASS/FAIL per check and exits 0 only when every check passes. Read-only: it changes no
file. Needs git.
"""
import argparse
import json
import math
import re
import subprocess
import sys
from pathlib import Path
ALLOWED_PREFIXES = ("tests/integration/", "docs/")
ALLOWED_FILES = {"CHANGELOG.md", "tests/inventory.sh"}
E2E = Path("tests/integration/e2e.sh")
RECORDED = ("peak_cpu_pct", "peak_rss_kib", "dashboard_latency_s")
results = []
def report(name, ok, detail=""):
results.append(ok)
print(f"{'PASS' if ok else 'FAIL'} {name}" + (f" [{detail}]" if detail else ""), flush=True)
def git(*args):
return subprocess.run(["git", *args], capture_output=True, text=True).stdout.strip()
def is_num(v):
return isinstance(v, (int, float)) and not isinstance(v, bool) and math.isfinite(v)
def is_int(v):
return isinstance(v, int) and not isinstance(v, bool)
ap = argparse.ArgumentParser()
ap.add_argument("--results", help="directory holding job.json and the job's downloaded artifacts")
args = ap.parse_args()
head = git("rev-parse", "HEAD")
# --- local -------------------------------------------------------------------------------
subprocess.run(["git", "fetch", "-q", "origin", "develop"], check=False)
base = git("merge-base", "origin/develop", "HEAD")
changed = set(git("diff", "--name-only", base).split())
report("C1 the harness changed, and only harness, docs, inventory and changelog files did",
any(p.startswith("tests/integration/") for p in changed)
and all(p in ALLOWED_FILES or p.startswith(ALLOWED_PREFIXES) for p in changed),
f"changed: {sorted(changed)}")
added = set(git("diff", "--name-only", "--diff-filter=A", base).split())
foreign = sorted(p for p in added if p.startswith("tests/") and not p.endswith(".sh"))
report("C2 no new test framework: every file added under tests/ is a bash script", not foreign,
f"non-.sh additions: {foreign}")
report("C3 e2e.sh keeps one worker as its default (workers: 1 unchanged)",
E2E.read_text().count("\nWORKERS=1\n") == 1)
# --- bench -------------------------------------------------------------------------------
BENCH = ["B1 job.json is a deploying tier4-e2e job with a borrowed rig, on this head",
"B2 job conclusion is success with no failed row (bench and borrowed rig verified back at baseline)",
"B3 the harness manifest names this head",
"B4 every baseline worker plus one distinct load-worker label was online together",
"B5 the harness expected baseline + 1 workers, and its 'workers online' row passed",
"B6 aggregate hashrate is positive and finite",
"B7 accepted shares advanced during the leg",
"B8 one failover transition was observed, and every worker recovered after it",
"B9 peak CPU/RSS and dashboard latency are recorded (evidence, no gate)"]
NAMES = ("job.json", "manifest.txt", "multi-worker-metrics.json")
found = {}
if args.results:
for name in NAMES:
hits = sorted(Path(args.results).rglob(name))
found[name] = hits[0] if len(hits) == 1 else None
if not args.results or not all(found.values()):
why = "bench evidence not supplied" if not args.results else \
f"need exactly one of each of {', '.join(NAMES)} under {args.results}"
for name in BENCH:
report(name, False, why)
else:
job = json.loads(found["job.json"].read_text())
rows = job.get("rows") or []
opts = job.get("options") or {}
manifest = found["manifest.txt"].read_text()
m = json.loads(found["multi-worker-metrics.json"].read_text())
m = m if isinstance(m, dict) else {}
report(BENCH[0], job.get("repo") == "pithead" and job.get("tier") == "tier4-e2e" and job.get("commit") == head
and not opts.get("no_rig") and opts.get("mode") != "check",
f"repo={job.get('repo')} tier={job.get('tier')} commit={job.get('commit')} options={opts}")
failed = [r.get("text") for r in rows if r.get("verdict") == "fail"]
report(BENCH[1], job.get("conclusion") == "success" and not failed,
f"conclusion={job.get('conclusion')} failed={failed[:3]}")
rev = re.search(r"^git_rev:\s*([0-9a-f]+)\s*$", manifest, re.M)
report(BENCH[2], bool(rev) and len(rev.group(1)) >= 7 and head.startswith(rev.group(1)),
f"git_rev={rev.group(1) if rev else None}")
baseline = m.get("baseline_workers")
label = m.get("load_worker")
good_baseline = (isinstance(baseline, list) and len(baseline) >= 1 and len(set(baseline)) == len(baseline)
and all(isinstance(b, str) and b for b in baseline))
report(BENCH[3], good_baseline and isinstance(label, str) and bool(label) and label not in baseline
and m.get("saw_ready") == 1,
f"baseline={len(baseline) if isinstance(baseline, list) else None} distinct_clone="
f"{good_baseline and isinstance(label, str) and bool(label) and label not in baseline} saw_ready={m.get('saw_ready')}")
want = len(baseline) + 1 if good_baseline else None
exp = re.search(r"^expected_workers:\s*(\d+)\s*$", manifest, re.M)
row = f"workers online (>= {want})"
verdicts = [r.get("verdict") for r in rows if r.get("text") == row]
report(BENCH[4], want is not None and bool(exp) and int(exp.group(1)) == want
and "pass" in verdicts and "fail" not in verdicts,
f"expected_workers={exp.group(1) if exp else None} want={want} '{row}': {verdicts}")
agg = m.get("aggregate_hashrate_hs")
report(BENCH[5], is_num(agg) and agg > 0, f"aggregate_hashrate_hs={agg}")
before, after = m.get("accepted_before"), m.get("accepted")
report(BENCH[6], is_int(before) and is_int(after) and before >= 0 and after > before,
f"accepted_before={before} accepted={after}")
report(BENCH[7], m.get("saw_failover") == 1 and m.get("saw_recovery") == 1,
f"saw_failover={m.get('saw_failover')} saw_recovery={m.get('saw_recovery')}")
rec = {k: m.get(k, "absent") for k in RECORDED}
report(BENCH[8], all(v is None or is_num(v) for v in rec.values()) and m.get("process_sampled") in (0, 1),
f"{rec} process_sampled={m.get('process_sampled', 'absent')}")
print(f"\n{'ACCEPTED' if all(results) else 'NOT ACCEPTED'}: {sum(results)}/{len(results)} checks pass")
sys.exit(0 if all(results) else 1)possible solutions
No distinct solution options are recorded; investigate the existing report before choosing an approach.
Activity
pithead-developer commentedon Sep 14, 2026
Questions before work continues (answer here, then remove the
questionlabel):What exact acceptance thresholds should the tier-4 worker leg enforce for aggregate hashrate/share progress, CPU, memory, and response time—and which failover route should it transition? My default would add one headless XMRig worker through the existing proxy, require three distinct worker labels, a positive aggregate and advancing accepted shares, cycle the proxy endpoint once, and record (but not gate on) peak process CPU/RSS plus dashboard response latency; this avoids inventing product limits while meeting the issue’s evidence requirement.
VijitSingh97 commentedon Sep 14, 2026
Ruling: your default is accepted. Gate on what the harness can prove: three distinct worker labels visible, aggregate hashrate positive and plausible, accepted shares advancing, one failover transition (cycle the proxy endpoint that already exists, forward and back) with every worker recovered, and a teardown that restores the baseline. Record peak process CPU/RSS and dashboard response latency in the job's summary and artifacts as evidence, with no gate on them. Do not invent product limits: file one
needs-triagefollow-up ("set load ceilings from measured tier-4 runs") so the numbers become gates once a few runs exist. This is a tier-4 leg on bench-ci; the image under test is the tier4-kvm build bench-ci makes for the branch.pithead-developer commentedon Sep 14, 2026
Questions before work continues (answer here, then remove the
questionlabel):May
tier4-e2etreatworkers: 3as the opt-in for a temporary low-thread XMRig clone on the borrowed rig (with the existing runner’s byte-for-byte restore), while requiring the other two baseline workers to already be visible? This is the smallest route that needs no bench-ci change; the defaultworkers: 1behavior remains unchanged.VijitSingh97 commentedon Sep 14, 2026
Ruling: yes.
workers: 3is the opt-in for a temporary low-thread XMRig clone on the borrowed rig, under a worker label of its own, through the runner's existing rig control and byte-for-byte restore;workers: 1stays the default and unchanged. Conditions: the clone is capped low (one thread) so the rig's real worker keeps mining; teardown and the restore run whether the leg passes or fails; and the leg asserts against the baseline it finds, baseline plus one distinct label, never a fixed three, so a one-rig bench (bench-ci#4) does not fail the leg on the bench's rig count. If the rig control cannot start a second miner without a bench-ci change after all, file that on bench-ci and returnblockedrather than widening the change.pithead-developer commentedon Sep 14, 2026
Blocked on p2pool-starter-stack/bench-ci#92. Job 209 never ran the tier command: the runner restarted during preflight and lost its active unit. Its complete log and empty artifact list confirm a bench-ci fault; stack baseline and borrowed-rig restoration were verified. The PR documents both bench runs and is ready to resume when bench-ci#92 is fixed.
The runner resumes this issue when that one closes.
pithead-developer commentedon Sep 14, 2026
Questions before work continues (answer here, then remove the
questionlabel):Should I continue into the renewed adversarial/security review and tier-4 retry on e845dbf? My default is yes, because this is the required path to prove the fixed lifecycle against the live runner.
40 remaining items
test(integration): exercise distinct workers through route recovery
pithead-developer commentedon Nov 2, 2026
Operator: PR #2175 is published at
59f83d581b6bondevelop-v2.1.0(owner authorized, 2026-11-02); it now needs fresh checks and review.pithead-developer commentedon Nov 3, 2026
Needs an operator action (do it, then remove the
operator-actionlabel):PR #2175 needs an owner-only rewrite of head branch
agent/1999-test-integration-exercise-multi-worker-rfrom observed remote head59f83d581b6ba542ac8e6dec0c0225c6cea955fcontodevelop-v2.0.3before it can merge. Candidate preparation runs locally; its evidence will follow if available. Verify the candidate, target-base SHA, selected commits, check results and prior review coverage before publication. Publish only to the same PR head branch with an explicit lease on59f83d581b6ba542ac8e6dec0c0225c6cea955fc, followed by the base change; if the remote head moved, stop and reassess. Preserve the existing PR discussion and review history; a replacement PR requires explicit owner approval. Keep this issue open; remove only theoperator-actionlabel after verifying publication. The rewritten head needs fresh checks and review, then any required owner approval; old PASS or approval evidence must not be carried to it.pithead-developer commentedon Nov 3, 2026
Candidate preparation for PR #2175 (owner publication still required):
PR #2175 is not ready to merge: its head carries develop-v2.1.0 commits that develop-v2.0.3 lacks, so changing the base now would pull them into the diff. I built a local candidate that fixes this and published nothing. Head branch:
agent/1999-test-integration-exercise-multi-worker-r. Observed remote head:59f83d581b6ba542ac8e6dec0c0225c6cea955fc. Candidate branch:candidate/1999-on-develop-v2.0.3at3c731aac11cadea8dd2fe2adb694e16c0f2b3832, in the local worktree for this issue. Target base:develop-v2.0.3atced8501e2edc6dc346c2f1e38c575d332df11a29. The candidate is that base plus one commit, cherry-picked from59f83d581("test(integration): exercise distinct workers through route recovery"). It touches 14 files, +493/-47. The cherry-pick conflicted once, intests/inventory.sh. I kept the develop-v2.0.3 exclusion list and added! -name load-worker.sh.Checks run on the candidate:
selftest-load-worker,selftest-e2e-forwarded-env,selftest-e2e-harness-args,selftest-e2e-phases,selftest-e2e-restore-proof,selftest-e2e-sweepandselftest-restore-mining-ready.make lint-file-budget,make lint-pithead-buildandtests/inventory.sh.origin/develop-v2.0.3, so not caused by this change:selftest-e2e-env: 59 passed, 1 failed ("a lost capture of a Tari refusal still carries its one tari-not-done line").selftest-wallet-fixture: 5 of 6 tests fail with the same assertion error on both. I did not investigate the cause.Existing review evidence, all tied to the old heads: bench job 2891 passed at
819c85e964562e14ebe76e4340fb897215a0d6f4(282 assertions, restoration verified), and the acceptance script passed 12/12 there. The verifier and security reviews were clean at that head, and the earlier rebuild's focused checks and reviews covered59f83d581. None of this applies to the candidate SHA.Owner action, before merge:
agent/1999-test-integration-exercise-multi-worker-ris still59f83d581b6ba542ac8e6dec0c0225c6cea955fc. If it moved, stop and reassess.3c731aac11cadea8dd2fe2adb694e16c0f2b3832to that branch with--force-with-lease=agent/1999-test-integration-exercise-multi-worker-r:59f83d581b6ba542ac8e6dec0c0225c6cea955fc. The pre-push hook rejects non-fast-forward updates, so the owner has to apply this.gh pr edit 2175 --base develop-v2.0.3.The rewritten head needs fresh GitHub checks, fresh bench evidence and a fresh review, then any owner approval. Do not carry over the old PASS or approval.
pithead-developer commentedon Nov 6, 2026
Operator: released to the runner (owner 2026-11-06). New work goes to the local Flash-Next model first; Claude only after three local rounds or for sensitive work.
pithead-developer commentedon Nov 6, 2026
Needs an operator action (do it, then remove the
operator-actionlabel):PR #2175 needs an owner-only rewrite of head branch
agent/1999-test-integration-exercise-multi-worker-rfrom observed remote head59f83d581b6ba542ac8e6dec0c0225c6cea955fcontodevelop-v2.0.3before it can merge. Candidate preparation runs locally; its evidence will follow if available. Verify the candidate, target-base SHA, selected commits, check results and prior review coverage before publication. Publish only to the same PR head branch with an explicit lease on59f83d581b6ba542ac8e6dec0c0225c6cea955fc, followed by the base change; if the remote head moved, stop and reassess. Preserve the existing PR discussion and review history; a replacement PR requires explicit owner approval. Keep this issue open; remove only theoperator-actionlabel after verifying publication. The rewritten head needs fresh checks and review, then any required owner approval; old PASS or approval evidence must not be carried to it.pithead-developer commentedon Nov 6, 2026
Candidate preparation for PR #2175 (owner publication still required):
PR #2175 cannot change its base to develop-v2.0.3 as it stands, because its head carries develop-v2.1.0 commits. I rebuilt the change locally and published nothing: no push, no force-push, no hook bypass, no PR base change, no replacement PR.
Facts:
agent/1999-test-integration-exercise-multi-worker-r.59f83d581b6ba542ac8e6dec0c0225c6cea955fc.develop-v2.0.3atffc3770599c61fe285e072d1e11b4a15fbb5d59f, fetched today.candidate/1999-on-develop-v2.0.3-r2, full SHA01c044cea387d6ae64d98d0d17849f09c51996dc, in the issue's local worktree. It is one commit on that base.59f83d581(test(integration): exercise distinct workers through route recovery), cherry-picked.candidate/1999-on-develop-v2.0.3at3c731aac1, sits on stale baseced8501e2. It is superseded; do not publish it.tests/inventory.sh, where the base added exclusions to the integration file list. I kept the base's list and added! -name load-worker.sh.Checks run on the candidate (BSD/GNU PATH as the repo requires):
selftest-load-worker,e2e-forwarded-env,e2e-harness-args,e2e-phases,e2e-restore-proof,e2e-sweepandrestore-mining-ready: all pass.selftest-e2e-env: 59 passed, 1 failed ("a lost capture of a Tari refusal still carries its one tari-not-done line"). It fails the same way on a cleanorigin/develop-v2.0.3checkout, so it predates this change.selftest-wallet-fixture: fails (failures=5) on the candidate and on a clean base checkout, so it predates this change. I did not investigate the cause on this Mac.make lint-file-budget,make lint-pithead-buildandbash tests/inventory.sh: exit 0.make test, tier-4 e2e, GitHub CI. A new head needs them.Existing review evidence, which does not carry to the rewritten head:
Owner action, before merge:
agent/1999-test-integration-exercise-multi-worker-ris still59f83d581b6ba542ac8e6dec0c0225c6cea955fc. If it moved, stop and reassess.01c044cea387d6ae64d98d0d17849f09c51996dcto that branch with an explicit lease on that observed head, for examplegit push --force-with-lease=agent/1999-test-integration-exercise-multi-worker-r:59f83d581b6ba542ac8e6dec0c0225c6cea955fc origin 01c044cea387d6ae64d98d0d17849f09c51996dc:refs/heads/agent/1999-test-integration-exercise-multi-worker-r. The mandatory pre-push hook rejects non-fast-forward updates, so this is owner-only.gh pr edit 2175 --base develop-v2.0.3. The PR discussion and review history stay on test(integration): exercise multi-worker routing under load #2175.origin/develop-v2.0.3has moved fromffc3770599c61fe285e072d1e11b4a15fbb5d59f, rebuild the candidate first.pithead-developer commentedon Nov 16, 2026
Closed as not planned (owner, 2026-11-16). This matches the 2026-10-16 lean-roadmap cleanup that closed PR #2175. Its branch is kept. Follow-up #2173 is closed with it.