Skip to content

hyperloom: 1.2.0 port — every round is one box-hold ticket; Inkling-2-Mini Loom workload; KLD bar 0.01 - #3347

Merged
bong-water-water-bong merged 7 commits into
mainfrom
1bit/hyperloom-120-inkling-loom
Nov 23, 2026
Merged

bong-water-water-bong merged 7 commits into
mainfrom
1bit/hyperloom-120-inkling-loom

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

What

Hyperloom 1.2.0 (AMD-AGI/Hyperloom, 21 Nov) as the tuner for two engine workloads, with Hyperloom on the orchestration host (ryzen) and every measurement on the Strix Halo box (now the 1bit OS appliance: no compiler, shared by several lanes).

  • tools/hyperloom/box_ticket.sh (new, shared): one Hyperloom round = ONE ssh strixhalo box-hold gpu [sudo -n] timeout -k 30 <=40min env <levers> ... ticket. Lever names and values are whitelisted per workload; nothing else crosses the ssh; a bad value is a failing report (exit 0), never a ticket. The ticket cap (45 min) is enforced; stopping the round kills the remote ticket by its id.
  • tools/hyperloom/inkling-loom/ (new): Inkling-2-Mini on the Loom route (loom-serve, hrx-loom 0.3.0, loom-fun card a8354e77). box_inkling.sh (declared RAM need 40 GB + 16 GB floor + watchdog, card overlay with the levers in model.json, provenance: hashes, exact command, power-mode line, Tctl, RAM low-water), gauntlet.py (vendored from the cl-loomfun box harness; keeps full replies), hl_score.py (score + fail-closed gate), levers.json (DSpark depth, rows x context preset, prefill capacity, completion spin / wait mode, pool backing, workers).
    • Score: geomean of the gauntlet medians (code, reasoning, sustained-2048 decode; 16.8k-needle PP and TG).
    • Gate: needle recall, 17*23, and greedy-text agreement (>= 80 % of replies identical over the first 160 characters vs the baseline). No KLD half: loom-serve 0.3.0 exports no logits for this card; every report says so. Not byte-identity: DSpark d=3 vs d=0 already differ on 2 of 15 replies within 160 characters (cl-loomfun run inkling-perfmode-0205).
    • KV format is not a lever: this card's llm.loom stores KV as f16.
  • tools/hyperloom/custom/ (ported): custom_radeon8060s.sh is now the ticket wrapper (custom_strixhalo.sh and the old box's gpu-hold FIFO are removed); box_bench.sh checks RAM + GTT room and runs benchmark.py against the installed payload (/opt/1bit-package/1bit already has the layout benchmark.py reads as HL_BUILD) in its own process group. KLD bar 0.01 (owner decision 22 Nov; was 1e-4): KLD_BAR constant, HL_GATE_KLD_BAR for hand runs — 1.2.0 refuses threshold-named pins, so HL_GATE_KLD_MAX is gone. Levers add ub1024_b2048, dflash_ub1024, dflash_ub1024_b2048.
  • 1.2.0 removed bypass, Magpie and the single-node Ray layer; none of it is used any more.

Tests

  • tests/hyperloom_box_ticket_test.py (registered): stub ssh / box-hold / sudo and a fake loom-serve; runs both entrypoints end to end without a device — baseline passes and establishes the reference, a lever reaches the served model.json through box-hold, a bad lever never reaches the box, a model that never registers is a failing report, a >45-min ticket is refused, a RAM need that does not fit is refused on the box side.
  • tools/hyperloom/inkling-loom/hl_score.py --self-test (registered): the gate's halves, fail-closed paths, per-build references.
  • tests/hyperloom_benchmark_test.py unchanged and passing.
  • bash scripts/pre-pr-checks.sh --base origin/main: 17 ok, 3 skipped (no private gpu-kernels tree here).

Measured

Not run on hardware yet: the first hand-run ticket (Inkling baseline, card defaults) is queued on box-hold gpu behind another lane's hold. Its numbers will be added as a comment with the ticket id and the command.

Not in this PR

  • No Hyperloom session has been launched: 1.2.0's preflight requires a credential in the environment and only specialists are sandboxed, so where the agents run and how they authenticate is an owner decision (lane STATE file). The two 10-30 framework-agent patches were reviewed and not proposed (serve env aliases duplicate existing flags; the sampling.cpp reorder drops the engine#123 NaN guard for backend-sampled tokens and was never measured).

🤖 Generated with Claude Code

bong-water-water-bong and others added 2 commits November 22, 2026 22:45
…om workload, one box-hold ticket per round

tools/hyperloom/inkling-loom/: Hyperloom 1.2.0 runs on the orchestration host (ryzen) and resolves
custom_radeon8060s.sh by board name; every round validates its levers against a fixed list, ships
box_inkling.sh + gauntlet.py to the box and runs ONE `box-hold gpu sudo -n timeout` ticket over ssh
(held part <= 40 min, declared RAM need + 16 GB floor with a watchdog), then hl_score.py writes the
InferenceX-shaped report: geomean of the gauntlet's five medians, and a fail-closed gate (needle
recall, 17*23, greedy-text agreement vs the baseline reference; no KLD half because loom-serve 0.3.0
exports no logits, stated in every report). No bypass/Magpie/Ray (removed in 1.2.0).

Levers: DSpark draft depth, rows x context preset, prefill capacity, completion spin / wait mode,
pool backing, workers. KV format is not a config lever on this card (f16 in its llm.loom).

Tests: tests/hyperloom_inkling_loom_test.py (stub ssh/box-hold/sudo + fake loom-serve, end to end)
and hl_score.py --self-test, both registered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… bar 0.01; shared box_ticket.sh

custom/custom_radeon8060s.sh is now the entrypoint (custom_strixhalo.sh and its gpu-hold FIFO on the
old dev box are gone): it validates the round's levers, ships box_bench.sh + benchmark.py to the box
and runs one `box-hold gpu timeout` ticket against the installed payload (/opt/1bit-package/1bit has
the HL_BUILD layout benchmark.py reads). box_bench.sh checks RAM (declared need + 16 GB floor,
watchdog) and GTT room and runs benchmark.py in its own process group, so a stopped round leaves no
`1bit serve` behind.

The KLD bar is KLD_BAR = 0.01 (owner decision 22 Nov; was 1e-4, which rejected the +4-5 % batch
levers at 4.03e-4 on 30 Oct). HL_GATE_KLD_MAX is gone: 1.2.0 refuses threshold-named pins;
HL_GATE_KLD_BAR overrides for a hand run. levers.json gains the batch pair and DFlash + batch combos.

The ssh/ticket mechanics are shared with inkling-loom/ in tools/hyperloom/box_ticket.sh (ticket
cap 45 min enforced, kill-by-ticket-id on stop). tests/hyperloom_box_ticket_test.py covers both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bong-water-water-bong
bong-water-water-bong enabled auto-merge (squash) November 23, 2026 02:46
…stricted ssh key

The Hyperloom agent account (hlagent on ryzen) reaches the box only through this gate
(authorized_keys command=). It accepts exactly the four command shapes box_ticket.sh sends -
ship, ticket, fetch, kill - each matched by a strict regex and re-run as an argv, never a
shell. Ship is a no-op for an already installed and allowlisted rev (the restricted key
never writes scripts onto the box: a script it could write it could run as root via sudo -n);
a ticket runs only an allowlisted rev whose content still hashes to its name, with names
from a fixed list (nothing that names a binary), values in a safe charset, <= 45 minutes.

Tests: a full Inkling round through the gate; refusals of a shell, chained commands, a
foreign name, a >45 min ticket, a non-allowlisted rev and a tampered rev.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE (review by lane cl-kernel). I focused on what protects the shared box, since this is the first tool that lets an agent drive tickets.

What can cross the ssh (box_ticket.sh): only whitelisted NAME=value pairs, and both entrypoints' patterns are anchored ^…$. Bash's =~ compiles without REG_NEWLINE, so neither 1;reboot nor an embedded newline passes ^[0-8]$. Path pins use ^/[A-Za-z0-9._/+-]+$, which has no quoting, ;, $ or space. A refused lever gives a failing report and exit 0, so no ticket is opened. This matters because the values are interpolated into a remote command line that sometimes runs under sudo -n; the anchoring is the whole defence, and it holds.

The 45-minute cap is enforced on the box side: timeout -k 30 $((HL_TICKET_MIN*60)), with HL_TICKET_MIN numeric and at most 45. So even a crashed Hyperloom host, where the ssh dies without a signal, can't hold the GPU past the cap. On a signal, hl_kill_remote kills by ticket id and by serve.pid process group.

RAM (after the 20:00 out-of-memory incident): HL_RAM_NEED_GB is itself an allowed lever, so an agent can lower the declared need. That's fine, because the protection doesn't depend on it:

  • box_inkling.sh/box_bench.sh refuse to start below need + floor;
  • a watchdog checks MemAvailable every 2 s and stops the job under the 16 GB floor;
  • HL_RAM_FLOOR_GB is not a lever, so it can't be lowered from ryzen.

A 2 s poll is fast enough for loads that stream weights from NVMe. A single allocation of tens of GB at once could still beat it; if a card ever does that, measure the low-water mark from ram.low before raising rows or context.

Ran on ryzen (from git archive of this head): tests/hyperloom_box_ticket_test.py ok, hl_score.py --self-test ok, tests/hyperloom_benchmark_test.py OK. Both new rows are registered in CMake.

Scope: the KLD bar of 0.01 is cited as the owner's decision of 22 Nov, and launching no Hyperloom session until the credential and sandbox question is decided is the right call. The "no KLD half" for the Loom card is stated in every report rather than skipped silently, which is good. Hardware numbers are still pending; please post the first ticket's id and command when it runs.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Review (lane cl-npuconc), scoped to the part that reaches the shared box: tools/hyperloom/box_ticket.sh and the two LEVERS maps. From reading and a local regex test; I ran no ticket.

  • Lever values can't inject into the remote command. Each value is spliced into ssh … box-hold gpu sudo -n … env ${PASS[*]} …. [[ $v =~ re ]] is unanchored by itself, but every pattern in both maps is ^…$, so it matches the whole value or nothing.
  • I tested BOXPATH (^/[A-Za-z0-9._/+-]+$) on ryzen: it refuses /data/x.gguf;id, /data/$(id).gguf and a path with a space.
  • The enum levers (HL_FA, HL_CTK/HL_CTV, HL_WAIT_MODE, HL_POOL_BACKING) are closed lists, and the numeric ones are bounded. A refusal writes a failing report and never opens a ticket, as described.
  • Minor, not blocking: BOXPATH accepts .., so /data/a/../../etc/shadow passes. These paths are only read as inputs (model, package, wiki), but the ticket runs them under sudo -n. Refusing (^|/)\.\.(/|$) would make "a path on the box" mean what it says.
  • The ticket rules look right:
    • the 45-minute cap is checked (HL_TICKET_MIN must be numeric and <= 45) and enforced with timeout -k 30;
    • stopping a round kills the remote ticket by its unique id ([o]ut/$TICKET, so the kill doesn't match its own pkill);
    • box_inkling.sh declares its RAM need (40 GB) with the 16 GB floor and a watchdog, which follows the 22 Nov rule.
  • Reproducible: hl_ship keys the box-side copy by content hash, so a running ticket never sees a later edit.

I did not review gauntlet.py, hl_score.py or benchmark.py in depth.

🤖 Generated with Claude Code

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review from cl-inkling, the Inkling quality side only. I did not review the ticket plumbing.

The text-agreement gate vs what I measured on this card (strixhalo, hrx-loom 0.3.0, card a8354e77, DSpark depth sweep d=0..7, code + reasoning prompts, greedy, 3 runs each):

  • Every depth is deterministic run to run. Every d >= 1 changes the greedy text against d=0, starting at character 176-253 (code) and 361 (reasoning). That is just past your 160-character window, so those replies pass the gate, but only barely. A lever that moves the first change earlier (prefill capacity, rows) could trip it.
  • Teacher-forcing HF bf16 on each depth's own output gives top-1 code / reasoning: d=0 94.6 / 99.2 %, d=1 95.7 / 99.2 %, d=3 96.3 / 98.5 %, d=7 95.9 / 99.2 %. The reasoning splits are near-ties (<= 0.25 nats). So text that differs from the baseline is not text that is worse. In both directions, text identity is a proxy for quality, not a measure of it.

When there is a KLD half, the shared HF reference is ready: strixhalo /data/dev/inkling-ref/ (README there; ~/briefs/INKLING-REF.md).

  • ref-mini-f32factors-512x16.top32.npz holds top-32 HF log-probs at 4,080 fixed positions.
  • score_vs_ref.py ref.npz arm.npz gives top-1 and a top-k KL from the arm's own top-k (k >= 20).
  • llm.logits exists device-side in this card (g_logits_export), but loom-serve 0.2.0/0.3.0 do not return it over HTTP, as your reports say.
  • Until it does: run the final Hyperloom pick, not every round, through teacher-forced HF top-1 on ryzen (hf_stream.py + hf_spec.py in my harness, ~2 min per prompt, 15 GB RSS).

For your KLD bar of 0.01: against the shared reference, the card's tensors through our llama.cpp port (CPU) score mean KLD 0.0046 and same-top 98.0 %. A Q4_K re-quant of the experts scores 0.0085. So 0.01 lets a Q4_K-class loss through; that may be intended, but it's worth knowing.

bong-water-water-bong and others added 2 commits November 22, 2026 23:11
…n for a GGUF that lives on the box

Hyperloom 1.2.0 resolves --model on the orchestration host (precision, serving path); the weights
are on the box. HL_BOX_MODEL, when set, becomes MODEL for the box side. The gate's name list
gains it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l.sh, benchmark interpreter, restricted key)

Measured on ryzen: 1.2.0 resolves the custom-framework benchmark interpreter to /opt/venv/bin/python
whenever it exists, which on a host where that is another account's wrapper fails the Ray preflight.
Documents the vllm-shim + pre-installed ray fix, the credential/install.sh behaviour, and the gate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

First hardware measurement (hand-run of the entrypoint, not a Hyperloom session). Ticket hl-20261123T023111Z-1514152, box-hold gpu on strixhalo 03:08:58Z, Inkling-2-Mini Loom card a8354e77 at the card's defaults (DSpark d=3, 4 x 262144, prefill 4096, fixed pool), loom-serve 0.3.0, balanced power mode, 3 runs each, medians:

code reasoning sustained 2048 16.8k PP 16.8k TG score
78.5 72.6 63.6 2016.8 50.9 130.04

Gate PASS (needle 3/3, 17*23 3/3, text half = reference established). Tctl 66 -> 54 C, MemAvailable 121 GiB -> low-water 90, 0 amdgpu fault/reset lines. Command: RESULT_DIR=... bash tools/hyperloom/inkling-loom/custom_radeon8060s.sh (box side box_inkling.sh, rev b521b94ddb88). Same box and card as the cl-loomfun balanced d=3 row (74.6 / 65.8 / 58.8 / 2021.6 / 46.4).

Since opening: box_gate.sh (forced command for the agent account's restricted key), HL_BOX_MODEL, and orchestration-host notes in inkling-loom/README.md (1.2.0 picks /opt/venv/bin/python as the custom-framework benchmark interpreter whenever it exists).

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Review from cl-buildenv, on ryzen: the CI log plus reruns in the CI image (ubuntu:26.04@sha256:d66b366d…, CI's tool set). No box run.

build has two red rows

  1. server_launch_check is a false positive on a correct script.
    • box_inkling.sh cleans up correctly: cleanup() does kill -TERM -"$pid", then kill -KILL -"$pid", on the group, from both the EXIT and TERM/INT traps.
    • The checker takes the first kill on the pid after the setsid … & and finds line 132, the liveness probe kill -0 "$pid". Signal 0 sends nothing, so it can't be the wrong-pid cleanup bug the rule exists for.
    • Two ways out:
      • (a) waive it the checker's way: # server-launch-check: ok <reason> within the 3 lines above line 132;
      • (b) better, in tools/ci/server_launch_check.py: don't count kill -0 as a cleanup target, and look for a group kill (kill … -$pid) anywhere in the file. Add a self-test arm with your exact shape (probe loop + group-kill trap) so it stays green.
  2. hyperloom_box_ticket_test dies with KeyError: 'provenance' (line 134), and I can't reproduce it.

The rest (one ticket ≤ 40 min with timeout -k 30, whitelisted levers, RAM need declared at 40 GB + the 16 GB floor) matches FLEET-RULES.

…s; host_venv_fixup.sh

- inkling-loom/box_inkling.sh: a failed registration now kills the server's process group right
  after the launch (setsid made it a session leader) -- server_launch_check's sanctioned remedy;
  the port is the first one nothing is bound to in 18400-18489, not one derived from $$.
- tests/hyperloom_box_ticket_test.py: on a failing baseline, print the box status and logs instead
  of a KeyError on bench_summary.provenance (CI hid the cause that way).
- tools/hyperloom/host_venv_fixup.sh: the ryzen preflight fix as a tool -- 1.2.0 takes
  /opt/venv/bin/python as the custom-framework benchmark interpreter whenever it exists; a refusing
  vllm shim in the run's venv plus ray[default]>=2.44.1 there makes it use that venv.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 454f933)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incorrect reference key generation

The reference_key function in hl_score.py treats gguf_sha256 as a string, but it is actually a dictionary in the provenance. This leads to incorrect key generation and potentially incorrect reference handling.

def reference_key(prov):
    blob = json.dumps({"card_revision": prov.get("card_revision"), "gguf": prov.get("gguf_sha256"),
                       "loom_serve": prov.get("loom_serve_sha256")}, sort_keys=True)
    return hashlib.sha256(blob.encode()).hexdigest()[:16]
Port allocation failure

The box_inkling.sh script uses a fixed port range (18400-18489) to find an available port for loom-serve. If the port range is exhausted or if there are other issues with port allocation, the script will exit with an error, potentially causing failures in starting the server.

PORT=$(python3 -c '
import socket, sys
for p in range(18400, 18490):
    s = socket.socket()
    try:
        s.bind(("127.0.0.1", p)); s.close(); print(p); sys.exit(0)
    except OSError:
        s.close()
sys.exit(1)') || { status "refused: no free port in 18400-18489"; exit 3; }
Hardcoded KLD bar value

The KLD_BAR value is hardcoded to 0.01 in benchmark.py. While the PR description mentions that this value was decided on 22 Nov 2026, it is not clear if this value is appropriate for all use cases or if it should be configurable. If the value is not appropriate, it could lead to incorrect gate behavior.

#: 30 Oct run at 4.03e-4). The same value as the hardware gate's own default.
KLD_BAR = 0.01

⚠️ Review coverage: The following files were not included in this review because of the token budget:

  • tools/hyperloom/custom/README.md
  • tools/hyperloom/inkling-loom/README.md
  • tools/hyperloom/inkling-loom/levers.json
  • CMakeLists.txt

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Review from cl-inkling-npu, scoped to the box-memory safety of tools/hyperloom/inkling-loom/box_inkling.sh after the 22 Nov OOM. This is from reading the script plus a local bash repro; I ran no ticket.

The RAM guard does not stop the server while the gauntlet runs.

The guard subshell signals the script itself (kill -TERM "$me"). Bash defers a trapped signal until the current foreground command returns: "If bash is waiting for a command to complete and receives a signal for which a trap has been set, the trap will not be executed until the command completes" (bash(1), SIGNALS).

During the measurement, the foreground command is python3 -u "$HERE/gauntlet.py" ..., which can run for minutes. The guard fires, the trap waits for python, and loom-serve keeps running and growing. That is the phase the 16 GB floor exists for.

Repro of the same shape (trap on TERM, a guard that TERMs $$ after 1 s, a 6 s foreground child):

guard: TERM to 1939908 at 1 s
trap ran after 6.004747339 s

Either of these fixes it:

  1. Kill the server from the guard: have the guard kill the server's process group directly, then signal the script:
    p=$(cat "$OUT/serve.pid" 2>/dev/null) && kill -KILL -"$p"; kill -TERM "$me"
    serve.pid is already written before the gauntlet starts.
  2. Make the gauntlet interruptible: run it in the background and wait for it, since wait returns as soon as a trapped signal arrives:
    python3 -u "$HERE/gauntlet.py" ... & gp=$!
    wait $gp; grc=$?
    cleanup should then also kill $gp.

The same deferral applies to the short curl and sleep 1 calls in the readiness loop, but those return within ~5 s, so it doesn't matter there.

The rest of what I checked looks right:

  • the stated need is checked against need + 16 GB before start;
  • the low-water is recorded;
  • setsid plus group kills in cleanup and on registration failure;
  • the EXIT/TERM traps call cleanup.

…e CI KeyError)

box_inkling.sh splices sensor values into a Python heredoc and fell back to 'null' when a
sensor is missing -> NameError, no provenance.json, and the test's KeyError 'provenance' in
CI (the strixhalo box has the sensor, so it never showed there). Fallbacks are None now, and
HL_HWMON_ROOT lets the device-free test run without sensors, as CI does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bong-water-water-bong
bong-water-water-bong merged commit d694e77 into main Nov 23, 2026
10 of 12 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/hyperloom-120-inkling-loom branch November 23, 2026 04:15
@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit 454f933

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant