Repository navigation
fix: enforce RandomX thread ceilings in supported XMRig profiles - #601
Conversation
|
Blocked on bench-ci#2248. Job The test harness, cap/auto/tuning regressions and restoration safety corrections are pushed in draft PR #601; the product serialization fix and green current-head proof are still pending. The bench-ci owner must reconcile the original reservation/recovery hold and record supported worker restoration before hardware proof resumes. No replacement job or host/lock change was attempted. |
VijitSingh97
left a comment
There was a problem hiding this comment.
Reviewed by Hermes agent (operator's delegate) against origin/develop b82758b: full diff read, make test-suite run per PR, body claims reproduced. Not a substitute for the owner's approval; merge stays with the operator.
Verdict: RETURN — branch contains test scaffolding but zero product code; #588 is not fixed here
The diff touches only tests/ (new test-thread-profile.py, e2e-thread-profile.sh, wiring). generate_xmrig_config still writes cpu.rx as a bare integer (rigforge.sh:1131,1153) and the THREADS_CAP clamp re-writes a scalar at rigforge.sh:1199 — exactly the #588 defect. The 9 failing Test-suite/Coverage tests are the expected red state of this test-first draft (count(): "XMRig profile is not an array or object"); local repro matches CI run 40437285290. The body itself says "Implementation … pending. This draft is not ready for independent review."
Fix-forward is bounded, all in rigforge.sh: (1) emit the XMRig-6 object form at :1131/:1153 ({mode:0, threads:$rx, max_threads_cnt:$rx, intensity:1, affinity:-1}); (2) cap max_threads_cnt/threads at :1199 instead of writing an integer; (3) normalize every cpu.rx reader/writer to number-or-object: :1520-1522 (HugePages sizing), :3328 (tuner overlay writes a scalar — must move with the writers or the deep-merge at :1185 type-clashes), :3042 (tune-summary display). The 9 tests then go green unmodified (they encode the operator ruling: auto 8 / tuned 12 / cap 16 → runs 8). One rebase hunk: tests/README.md release-e2e table row (union develop's upgrade-phase wording with the thread-profile phase). Hardware/tier4-e2e proof remains blocked on bench-ci#2248.
@#600 tracker: this keeps #588's "proven by ~2026-10-30" fallback clause live — the fallback (cut 1.18.1 without #588) is the current trajectory unless the implementation lands.
XMRig 6.26.0 parses cpu.rx as a per-thread array or a profile object; a
bare integer falls back to the full-core default, so the setup cap was
silently ignored and autotune benchmarked against a knob it never set.
cpu.rx is now written in exactly the forms XMRig honors: omitted for
auto, a {mode,threads,max_threads_cnt,intensity,affinity} object when a
count is requested, or the observed auto array. A bounded probe run
(sink pool, no HTTP/DAEMON/MSR) observes the auto profile XMRig picks on
this box; every requested count - the setup cap and each tune candidate -
is clamped to it, so a cap can never raise thread count. Readers
(RX_SETUP_THREADS display, tune knobs, overrides) accept all forms.
Helpers live in util/rx-profile.sh, sourced beside the script: SCRIPT_DIR
is the worker home under RIGFORGE_HOME, not the script tree. The e2e
assertion counting threads through /2/backends stays gated to bench-ci
hardware (bench-ci#2248).
|
3bbe717 lands the RETURN scope in product code: object-form |
# Conflicts: # tests/README.md
|
Merge conflict resolved (tests/README.md release-e2e row unioned: develop's missing-minimum-marker upgrade phase + this branch's thread-profile phase and bench-ci phase entry), merged head f42e315. Operator-delegate verification on this head: make test-suite 2432 passed / 0 failed; python3 tests/test-thread-profile.py 12/12; all tracked *.sh parse clean under /bin/bash 3.2.57 (bash -n sweep). Review of the probe (util/rx-profile.sh): Linux+binary gated, sink config 0600 in mktemp dir with dead 127.0.0.1:1 pool, huge-pages/wrmsr/rdmsr and http off, deadline-bounded kill, temp cleanup; cpu.rx emitted only as observed array / threads object / omitted, eff = min(auto, cap, request) — matches the operator ruling the tests encode. Hardware /2/backends proof remains gated on bench-ci#2248; awaiting operator approval. |
|
Operator review of head f42e315 (not an approval): please do not merge yet.
|
|
PASS What I investigatedRe-review of PR 601 (closes #588) at head 9edd611. I reviewed the diff from the last reviewed head, dce294d, which is present in this clone. The worker's only commit is 5f9a9a0. d225dd8 came from develop (#693), and the merge 9edd611 only shortens lines to fit the file budget. The earlier blocking finding is fixed: an overlay-pinned
Reviewed head: |
Owner brief for
|
|
PASS What I investigatedRe-review of #601 at head cd1c0d0. dce294d is in the clone, and I reviewed the diff from dce294d to cd1c0d0. The worker made one commit of their own, 5f9a9a0 (the fix for the object-pin clobbering). The rest is two develop merges (#693, #608), whose conflict resolutions are limited to tests/README.md, the phase lists in tests/e2e-pithead.sh and the suite registration in tests/run.sh. The round-1 return is fixed. The fix's four new tier-1 assertions fail with the fix reverted and pass on the head. Hardware job 4005 passes on 9edd611, which holds all of the PR's own code, including the new object-clamp path. The only product change after it is develop's #608 (autosave/watch off, restart when the config changes), and that does not reach the thread-profile path.
Reviewed head: |
Owner brief for
|
What's the problem
Closes #588
RigForge wrote the RandomX thread count as an integer, which XMRig 6.26 silently ignores, so
threadscaps and tuned counts mined on every core.How I fixed it
cpu.rxnow takes only forms XMRig 6.26 honours:{}for auto, a{mode, threads, max_threads_cnt, intensity, affinity}object when a count lands below auto, or the observed auto array at the ceiling. One short probe run of XMRig against a from-scratch sink config (dead local pool, no credentials, HugePages, MSR or API; killed and cleaned on every path) observes auto, so the result ismin(auto, cap, tuned)and a cap never raises threads. Setup config generation, tune candidates (including the auto candidate), the tune overlay and summary, HugePages sizing, and shared-host profiles all use the same helpers (util/rx-profile.sh).Merging
develop's XMRig configuration overlay (#604) keeps one cpu.rx write path: config generation and tune candidates merge the overlay first, then apply the thread profile through the honoured-form helpers, which already enforce the thread cap, so the overlay branch's scalar-capping helper is dropped; a non-numeric thread profile pinned through the overlay passes through the tune knobs and the final overrides unchanged instead of being wrapped into a count object. An operator's pinnedcpu.rxobject is operator-owned: onlythreadsandmax_threads_cntmove when the cap or the observed auto ceiling clamps the count,mode,intensityandaffinitykeep their pinned values, and a pinned object at or below the ceiling generates unchanged;setupsizes HugePages from an object pin's thread count too.Shortcut: if the probe cannot run on a box with a miner, RigForge warns and applies the cap without the auto ceiling; upgrade when a second auto source exists. Whether XMRig 6.26 honours the object keys is proven only by the hardware phase below.
Here is the proof
Ponytail review: cut the dummy-listener probe idea and a duplicate hardware phase; kept validation, tests and docs.
Head
9edd611carries, on top of thedce294dmerge ofdevelop(#604): the fix for the reviewer-found clobbering of overlay-pinnedcpu.rxobjects, and a merge of the newerdevelop(#693 XMRig logging defaults) with the thread-profile suite registration and tune-knob profile pick single-lined to stay inside the rigforge.sh and tests/run.sh file-budget ceilings. Offline on this head: four new tier-1 assertions inbash tests/test-xmrig-overlay.share red ondce294d(77 passed, 4 failed— e.g.object profile without a cap generates unchanged — expected [1 4 4 2 5], got [0 4 4 1 -1]) and green here (81 passed, 0 failed). All 10 GitHub checks are green on9edd611.bash tests/test-xmrig-overlay.sh81 passed 0 failed on this head (its thread-cap-over-overlay and tune-candidate-cap assertions read the count out of the honoured object form),bash tests/test-xmrig-logging.sh11 passed (from #693),bash tests/test-suite-liveness.shPASS,timeout 200 python3 tests/test-thread-profile.py18 tests OK,bash tests/test-randomx-mode.shPASS,bash tests/test-config-atomic.shall passed,FILE_BUDGET_REQUIRE_BASE=1 bash scripts/lint-file-budget.shpasses. The verifier ran three times and the security reviewer once ona020d6d; every finding was fixed or is noted (known low item: the tune winner pins the requested count while generation applies the clamped one, so HugePages can be sized for the requested count).Hardware proof — the thread-profile phase passes on this head (job 4005, first block below). The same phase passed on the merge head
dce294das job 3999 and on the pre-merge head a020d6d as job 3972 (the last commit before that merge changed only the auto-profile cache and probe binary path), and earlier on b00639b as job 3970; since 3999 the head gained only the reviewer-found object-pin fix and file-budget line trims:bench-ci job 4005@9edd6115aa33580b5977f14925c055c7483a370e · rigforge · tier4-e2e
Generated by
bench-ci evidence 4005@9edd6115aa33580b5977f14925c055c7483a370e; re-run it to check.bench-ci job 3999@dce294d77fc0a458f7ab8e5667cc5c975f824736 · rigforge · tier4-e2e
Generated by
bench-ci evidence 3999@dce294d77fc0a458f7ab8e5667cc5c975f824736; re-run it to check.bench-ci job 3972@a020d6d9207faa2fefd38dca2b528feee52b5b0c · rigforge · tier4-e2e
Generated by
bench-ci evidence 3972@a020d6d9207faa2fefd38dca2b528feee52b5b0c; re-run it to check.Pre-fix negative control (original defect, XMRig ran 48 threads with cap 1; the error conclusion is the restoration hold since resolved in bench-ci#2248):
bench-ci job 3038@5a2f3ab86d66c7574aab491e4001985cb6608d0b · rigforge · tier4-e2e
Generated by
bench-ci evidence 3038@5a2f3ab86d66c7574aab491e4001985cb6608d0b; re-run it to check.