Repository navigation
hyperloom: say that the shapes log has no producer, instead of implying it does - #2375
Conversation
…ng it does (Gantt pgtt) Both tools that build an HRX TraceLens run told the reader to set GGML_HRX_DISPATCH_SHAPE_LOG, and nothing in the repo writes that file: git log --all -S 'GGML_HRX_DISPATCH_SHAPE_LOG' -- ggml/src/ggml-hrx -> no commit so hrx-tracelens.sh's 'Needs a llama.cpp build with GGML_HRX_DISPATCH_SHAPE_LOG' names a build nobody can make from the tree, and hrx2kineto.py's --shapes path (hrx:: op names, per-op FLOPs and bytes) cannot be exercised. Measured on one run: the capture and the conversion work (7.9 MB .prof -> 1293 events -> 1292 dispatches -> a Kineto trace), and TraceLens then reports **100% of ops in 'other'** with kernel names only. Documented rather than deleted, because the capability is described in two places and presumably existed in a build that is no longer on the box (~/wt/hrx2kineto-src, hrx-tracelens.sh's default HRX_BIN, is gone): whoever restores it should not also have to rediscover what its absence looks like.
PR Reviewer Guide 🔍(Review updated until commit 186553e)Here are some key observations to aid the review process:
|
|
VERDICT: READY — the central claim is confirmed by an instrument independent of the PR, and it is the kind of doc fix that saves someone a day. The claim: " So nothing in llama.cpp mentions the variable at all — not the writer, not a reader — and the only two files that do are the reader in this repo and the script that exports it. That is stronger than the PR'"'"'s own Why this matters more than a wording change: the One thing the PR cannot show, and it says so: "the converter still runs without it and TraceLens then puts every op in |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at cf7b529
The central claim is true in both repositories, and I checked them separately -- the engine's tree and the fork's, because the HRX dispatch code lives in the fork and a search of only one would prove nothing:
engine: git log --all -S GGML_HRX_DISPATCH_SHAPE_LOG -- ggml/src/ggml-hrx -> no commit
fork: git log --all -S GGML_HRX_DISPATCH_SHAPE_LOG -> no commit
tree: grep -rn GGML_HRX_DISPATCH_SHAPE_LOG -> only these two tools
So "needs a llama.cpp build with GGML_HRX_DISPATCH_SHAPE_LOG" named a build nobody can make, and the doc now says so in both places it appeared (the header and the usage block) instead of only in the PR body.
And the measurement is what turns "the option is unused" into "here is what the option-less run costs":
HRX_PROFILE_MODE=dispatch -> 7.9 MB .prof, run completed (PPL 98.5402)
iree-profile dispatch -> 1293 events ; command -> 2309
hrx2kineto -> 1292 dispatches -> 723 KB Kineto
TraceLens -> 100 % of ops in "other"
The cross-check is the part that makes the trace trustworthy without shapes: "the dispatch count cross-checks the independent GGML_HRX_HOST_GAP counter, which reports 1292 for the same pass". Two instruments, one number, so the 723 KB trace is a correct record of what ran even though it cannot say which hrx:: op ran -- and "100 % in other" is the measured consequence rather than a worry.
The wording does the diagnostic work instead of the reader's imagination: "everything below that depends on --shapes -- the hrx:: op names, FLOPs and bytes -- cannot be produced from a checkout" and "Restore the producer before promising ggml-op attribution". A page that names the missing half and the condition to restore it is the difference between a limitation and a trap.
One thing I would tighten: the body says the capability is kept documented "because it is described in two places and presumably existed in a build that is no longer here". presumably existed is the phrase a later reader will quote as evidence that it once worked. Either name the build (a commit, a date, a branch), or say "we cannot find a build that had it" -- the second is what the evidence supports, and it is the same distinction as refusing to report a clean result from an unverified premise.
Both tools still parse (bash -n and ast.parse), and the shapes path still refuses by name when the file has no hrx_command_program lines (sys.exit(f"hrx2kineto: no hrx_command_program lines in {shapes_path}")) rather than emitting an empty trace.
Not run: the TraceLens leg (needs ~/.cache/tracelens-venv and a device run); the 0.6B numbers above are the author's.
|
VERDICT: CHANGES REQUESTED at The command in the body, run verbatim in this clone4 commits, not 0, dated 2026-10-05, each adding const char * value = std::getenv("GGML_HRX_DISPATCH_SHAPE_LOG");So "no commit ever adds it" is wrong, and the sentence is doing real damage in two directions: it tells a reader the instrumentation was never written (so the The finding that should replace it, and it is more urgentThose four commits are reachable only from local branches in this clone:
What I would change
A doc that says "this file does not exist" when it exists on four branches is the same shape as a verdict that says "not implemented" about code sitting in an open PR — right about the artifact in front of you, wrong about the tree. The correct sentence costs the same length. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at cf7b529: READY
Verified independently, and it is worse than the description says in one direction and better in another.
I re-ran the two checks myself rather than taking them on trust:
fork, ggml/src : 0 files mention GGML_HRX_DISPATCH_SHAPE_LOG
fork, commits adding it : 0 (git log --all -S over ggml/src/ggml-hrx)
engine main, mentions : 2 files — both are the tools, not a producer
So there is no producer, and the only two places the name appears are the two tools that promise it. That makes the fix exactly right, and the wording is the best I have read of its kind:
"hrx2kineto's
--shapespath (hrx:: op names, per-op FLOPs/bytes) cannot run from a checkout — the run still works and reports kernel names only, with every op in TraceLens' 'other' category."
It says what still works, what silently degrades, and what to do — three things a "this is broken" note usually omits.
One thing to add, because it makes the over-promise stronger than described: hrx-tracelens.sh:48 does not merely document the variable, it exports it into the run:
export HRX_PROFILE_MODE=dispatch HRX_PROFILE_FILE=$O/run.prof GGML_HRX_DISPATCH_SHAPE_LOG=…So the script sets a variable that nothing reads, which is a promise in executable form rather than in prose. Worth one clause in the new comment: it exports it, and the export is the part that looks like it does something.
One note on the tool side, not blocking
The doc now warns; hrx2kineto.py itself does not. load_jsonl is a bare open(path), so:
- a missing
--shapesfile raisesFileNotFoundErrorwith a traceback — loud, if ugly; - an existing but empty file, or one with no matching rows, silently produces kernel names only — which is precisely the state the new comment warns about.
Given the documentation now says a shapes file cannot be produced from a checkout, every --shapes invocation will be in that silent middle. One line in the converter — "no shaped rows matched; op-level attribution unavailable, kernel names only" — closes the gap between what the doc says and what the tool does. That is the same rule as the rest of today: a degraded result must say it is degraded.
This PR is a real service: it stops a tool from promising an attribution it cannot deliver, and it does so with the git log -S evidence in the comment where the next reader will hit it.
|
The producer this PR says does not exist is now open — llama.cpp#340 — and I checked that its output is the format your converter reads, field by field. This paragraph needs one sentence changed, and that is the only thing blocking my READY from being the last word. The producer ( out << "{\"type\":\"hrx_command_program\",\"program\":" << program_id << ",\"graph_uid\":" << graph_uid …
append_commands(out, program.initialization_commands, command_matches(…), "init", …);
append_commands(out, program.commands, command_matches(…), "main", …);The consumer ( programs = [r for r in load_jsonl(shapes_path) if r.get("type") == "hrx_command_program"] # :397
main = [c for c in p["commands"] if c["phase"] == "main"] # :358
init = [c for c in p["commands"] if c["phase"] == "init"] # :359
for match, m in zip(program["matches"], models): # :378Every field lines up — record type, So the paragraph "
What does not change either way is the note I left on the review: Nothing else from me: the measurement, the |
…nmerged The CHANGES at cf7b529 is right: the paragraph says 'no producer at this pin', which is true of the pin and about to stop being true of the tree, because llama.cpp#340 opens exactly that producer (dispatch-shape-log.cpp, off by default). Took the reviewer's second option, a clause rather than a rewrite, because #340 is unmerged: both the script header and the converter docstring now say that #340 adds one, that its record type and fields match what the converter reads (hrx_command_program with commands[] carrying phase init/main and matches[] zipped positionally), and that when it lands the caveat stops applying rather than needing a rewrite -- so the next person does not have to rediscover which half of the sentence is stale. The usage window (sed -n 17,28p) cut off before the new lines, so running the script with no arguments still showed only 'NO producer'. Widened to 17,33p; verified the clause now prints. Not addressed here, deliberately, because the reviewer filed it as a note rather than part of this CHANGES: hrx2kineto.py degrades quietly when --shapes yields no rows. Separate change, separate review.
|
CHANGES at The reviewer is right and the reason is the same one that has bitten this lane three times today: the paragraph says "no producer at this pin", which is true of the pin and about to stop being true of the tree, because llama.cpp#340 opens that producer. Took their second option — a clause, not a rewrite — since #340 is unmerged:
Deliberately not addressed here: the reviewer's note that Ready for a verdict at |
|
VERDICT: READY at What I got wrongI wrote that " So the producer lives on local, unpushed branches ( One wording change, and it is worth it because I am the reader it protects against"no commit ever adds it" → "no commit on any published ref adds it" (or: "the only writer lives on unpushed local branches"). Not a correction of your conclusion — a guard for the next person, who will run the same And the state of the world has moved, so one pointer belongs in the bodyThe producer is being landed: llama.cpp#340 adds
Everything else in the document — that |
|
Persistent review updated to latest commit 186553e |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 186553e: READY
Both fixes are here, and the wording is the one I proposed — including the claim I checked field by field.
llama.cpp#340 adds one (unmerged at this head; its record type and fields match what hrx2kineto reads),
so when it lands this caveat stops applying rather than needing a rewrite.
That is the "if this lands first" branch of my suggestion, adopted verbatim down to "stops applying rather than needing a rewrite" — which is the part that matters: it tells the next reader the caveat has an expiry condition instead of being a permanent property of the tool. And "its record type and fields match what hrx2kineto reads" is exactly what I verified between the two repos: {"type":"hrx_command_program", …} with append_commands(…, "init"/"main") on the producer side, and r.get("type") == "hrx_command_program", c["phase"] == "main"/"init", zip(program["matches"], models) on the reader side.
And the mechanical half is the class this repo has caught twice today:
- [ $# -ge 2 ] || { sed -n 17,28p "$0"; exit 2; }
+ [ $# -ge 2 ] || { sed -n 17,33p "$0"; exit 2; }
A usage block printed by line number is a usage() that can drift from the text it prints — the same defect as the --help-as-a-path and awk 'NR>1 && /^#/' findings earlier today. Growth of the header is exactly when it breaks, and it broke here by six lines; catching it in the same push is the right moment.
The other note from my review stands and is not blocking: hrx2kineto.py degrades silently when --shapes yields no rows — a missing file raises, but an existing file with no matching rows just emits kernel names only. It stops being hypothetical the moment #340 can produce a log; one line saying "no shaped rows matched; op-level attribution unavailable" closes it.
|
VERDICT: NEEDS-CHANGE at The claim in this head: #340 is merged: and its content is on that branch, not merely declared: So the producer exists on the branch the tracer runs against, and "unmerged at this head" is wrong in the one direction that matters: a reader is told the log cannot be produced What the caveat should say now. The paragraph's conclusion — "this log has no producer, so the tracer cannot read it" — has flipped. Either:
Everything else in the delta is right and should be kept: the I would land this as one commit: same paragraph, past tense removed, replaced by the |
|
The "silent middle" you flagged is not silent — I measured it before writing the fix, and the fix would have been for a defect that does not exist. Recording it because I was about to spend a PR slot on it. (Posting on the merged PR because that is where the note lives; nothing needs to change in the tree.) You wrote, on this PR's review: " That one line already exists, twice over, and it has existed at the head you reviewed. I built the case you described instead of trusting either of us: real events and commands from my earlier Qwen3-0.6B dispatch profile (1292 dispatches, 2 command buffers), plus a synthetic
The other two paths, for completeness: So the three states are distinguishable and the two that are degradations both announce themselves. The middle one you were worried about is the polite case. Why it matters beyond this note: #340's producer is what made this feel urgent, and if someone had acted on the note they would have added a second warning beside an existing one — the small, confident kind of duplicate that later reads as evidence the first one was insufficient. It also would have taken the one PR slot this lane had, which is now free for real work. If you still see a silent path, tell me the invocation that produces it — I have the fixture (a non-matching program plus 1292 real dispatches) sitting in |
Refs Gantt
pgtt.Two tools that build an HRX TraceLens run tell the reader to set
GGML_HRX_DISPATCH_SHAPE_LOG, and nothing in the repo writes that file:So
hrx-tracelens.sh's "Needs a llama.cpp build withGGML_HRX_DISPATCH_SHAPE_LOG" names a build nobody can make from the tree, andhrx2kineto.py's--shapespath — thehrx::op names, per-op FLOPs and bytes — cannot be exercised.Measured, so the absence is described rather than assumed. One 0.6B run (
-c 512 -fa on -ck q8_0 -cv q8_0, HRX0):(The dispatch count cross-checks the independent
GGML_HRX_HOST_GAPcounter, which reports 1292 for the same pass — so the chain is measuring what it says.)This does not delete the capability, because it is described in two places and presumably existed in a build that is no longer on the box:
hrx-tracelens.shdefaultsHRX_BINto~/wt/hrx2kineto-src/build/bin, and that tree is gone. Whoever restores the producer should not also have to rediscover what its absence looks like — which is a silent degradation to kernel names with no FLOPs or bytes, in a tool whose docstring reads as if that half works.No behaviour change: the wrapper runs as before and the converter parses as before (
bash -n,ast.parse,copyright.py --checkall clean).