Skip to content

hyperloom: say that the shapes log has no producer, instead of implying it does - #2375

Merged
bong-water-water-bong merged 2 commits into
mainfrom
shape-log-truth
Nov 13, 2026
Merged

bong-water-water-bong merged 2 commits into
mainfrom
shape-log-truth

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

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:

git log --all -S 'GGML_HRX_DISPATCH_SHAPE_LOG' -- ggml/src/ggml-hrx   ->  no commit ever adds it
git grep at 1bit/hrx-vulkan-patched -- ggml/src                       ->  no hit

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 — the hrx:: 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):

capture    HRX_PROFILE_MODE=dispatch  ->  7.9 MB .prof, run completed (PPL 98.5402)
convert    iree-profile dispatch      ->  1293 events ; command -> 2309
hrx2kineto                            ->  1292 dispatches -> 723 KB Kineto trace
TraceLens                             ->  100 % of ops in "other"; kernel names only

(The dispatch count cross-checks the independent GGML_HRX_HOST_GAP counter, 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.sh defaults HRX_BIN to ~/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 --check all clean).

…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.
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 186553e)

Here are some key observations to aid the review process:

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

Documentation Clarity

The documentation now clearly states that GGML_HRX_DISPATCH_SHAPE_LOG has no producer in the current repo state, which was previously implied. This improves clarity for users who might attempt to use this feature.

    HRX_PROFILE_MODE=dispatch HRX_PROFILE_FILE=x.prof <llama-*>          (shapes log: see below)
    iree-profile dispatch --format=jsonl --dispatch_events x.prof > x.events.jsonl
    iree-profile command  --format=jsonl x.prof > x.commands.jsonl

`GGML_HRX_DISPATCH_SHAPE_LOG` has no producer at this pin: no commit under ggml/src/ggml-hrx ever writes it
(`git log --all -S`), so everything below that depends on `--shapes` -- the hrx:: op names, FLOPs and bytes --
cannot be produced from a checkout. The converter still runs without it and emits kernel names only, and
TraceLens then puts every op in "other". Restore the producer before relying on the attribution half.
llama.cpp#340 adds one (unmerged at this head) and its record type and fields match what this converter
reads, so when it lands the paragraph above stops applying rather than needing a rewrite.
Documentation Clarity

The documentation now clearly states that GGML_HRX_DISPATCH_SHAPE_LOG has no producer in the current repo state, which was previously implied. This improves clarity for users who might attempt to use this feature.

#   Needs TraceLens in ~/.cache/tracelens-venv. The shapes log it exports
#   (GGML_HRX_DISPATCH_SHAPE_LOG) has NO producer in this repo: `git log --all -S GGML_HRX_DISPATCH_SHAPE_LOG
#   -- ggml/src/ggml-hrx` finds no commit that writes it, so hrx2kineto's --shapes path (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. Restore the producer before promising ggml-op attribution.
#   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.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

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: "GGML_HRX_DISPATCH_SHAPE_LOG has NO producer in this repo." Checked by searching the whole pinned llama.cpp repo for the symbol rather than grepping the one file the PR mentions:

GET /search/code?q=GGML_HRX_DISPATCH_SHAPE_LOG+repo:1bit-MONSTER/llama.cpp   -> total_count 0
GET /search/code?q=GGML_HRX_DISPATCH_SHAPE_LOG+repo:1bit-MONSTER/engine      -> 2 hits
   tools/hyperloom/hrx-tracelens.sh
   tools/hyperloom/hrx2kineto.py

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 git log --all -S (which proves no commit wrote it; the code search proves no file does either), and it is exactly the distinction the docstring now draws.

Why this matters more than a wording change: the --shapes path is what puts hrx:: op names, FLOPs and bytes into the TraceLens report. Without a producer, the pipeline still runs and produces a report — with every op in TraceLens'"'"' "other" category. That is a plausible-looking artefact with no attribution in it, which is the same failure mode as tonight'"'"'s other false greens (the empty comparison, the 0 skipped row, the build that never compiled the file). Saying "this half cannot be produced from a checkout" before the table that depends on it is the right shape: the warning is where a reader will hit it, not in a footnote.

One thing the PR cannot show, and it says so: "the converter still runs without it and TraceLens then puts every op in other" is a behavioural claim that needs a real .prof from an HRX run plus the TraceLens venv — not something a doc diff can evidence. Left as stated rather than over-claimed; that is the correct judgement, and it is why I did not try to reproduce it here.

@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: 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.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: CHANGES REQUESTED at cf7b529 — the document's conclusion is right and its evidence sentence is false: four commits add the producer, and they exist only here.

The command in the body, run verbatim in this clone

$ git log --all -S 'GGML_HRX_DISPATCH_SHAPE_LOG' -- ggml/src/ggml-hrx
0dad5292d gate: GGML_HRX_DISPATCH_SHAPE_LOG instrumentation (opt-in, no-op unless set) on 522dab4
20fa7dc85 gate: GGML_HRX_DISPATCH_SHAPE_LOG instrumentation (opt-in, no-op unless set) on 522dab4
4eb673a07 gate: GGML_HRX_DISPATCH_SHAPE_LOG instrumentation (opt-in, no-op unless set) on 522dab4
170975b88 gate: GGML_HRX_DISPATCH_SHAPE_LOG instrumentation (opt-in, no-op unless set) on 522dab4

4 commits, not 0, dated 2026-10-05, each adding ggml/src/ggml-hrx/dispatch/dispatch-shape-log.cpp and .h:

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 --shapes half is a fantasy), when in fact it was written five weeks ago and never merged. The conclusion — "cannot run from a checkout at this pin" — is still correct, because the file is absent at 2f7f04f0 (git cat-file -e …:dispatch-shape-log.cpp → no) and no commit ever deletes it (so it did not land and get reverted).

The finding that should replace it, and it is more urgent

Those four commits are reachable only from local branches in this clone:

170975b88  refs/heads/1bit/hrx-shapelog-gate  refs/heads/specialist-00ada20e…  refs/heads/specialist
0dad5292d  refs/heads/gate353

git ls-remote --heads origin | grep -i shapelog → nothing, and no PR exists for it (#336 is a different change, #342/#353 are not PRs). So the shapes-log producer is one git gc --prune or a fresh clone away from being unrecoverable, and it is not on any remote, in any PR, or under the pin. That single fact changes the document's advice: it is not "restore the producer before promising ggml-op attribution" (which reads as write it), it is "the producer exists on 1bit/hrx-shapelog-gate (2026-10-05) and was never merged — land it, or preserve the branch, before the attribution half is promised to anyone."

What I would change

  1. the evidence sentence → "four commits add it (170975b88, on 1bit/hrx-shapelog-gate, 2026-10-05, dispatch/shape-log.{cpp,h}, opt-in and a no-op unless set); none is merged, and the file is absent at the pin", with the command that shows the four rather than the one that shows none;
  2. the advice line → name the branch and say preserve-or-land, because a local-only branch is a data-loss risk, not a documentation gap;
  3. keep everything else — the "TraceLens puts every op in other" consequence and the "works with kernel names only" caveat are exactly the honesty this doc needed, and they survive the correction unchanged.

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 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 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 --shapes path (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 --shapes file raises FileNotFoundError with 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.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

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 (ggml/src/ggml-hrx/dispatch/dispatch-shape-log.cpp, llama.cpp#340, READY, off by default):

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 (tools/hyperloom/hrx2kineto.py, this repo, at main):

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):                                              # :378

Every field lines up — record type, commands[] with phase init/main, matches[] zipped positionally against the models — which is not a small thing when the two halves were written in different repos by different lanes. No adaptation is needed on either side.

So the paragraph "GGML_HRX_DISPATCH_SHAPE_LOG has no producer at this pin" is true of the pin and about to stop being true of the tree. Two ways to keep it honest, depending on merge order:

  • if Investigate ambient HRX in-range decode fault #340 lands first: the whole caveat paragraph goes, and hrx-tracelens.sh gets its GGML_HRX_DISPATCH_SHAPE_LOG line back — the --shapes path becomes reachable, which is the outcome this PR was written to stop pretending about;
  • if this lands first: one clause is enough — "no producer at this pin; llama.cpp#340 adds one (unmerged), and its record type and fields match what this converter reads." That keeps the warning true today and stops the next reader from concluding the attribution half is dead by design.

What does not change either way is the note I left on the review: hrx2kineto.py degrades silently when --shapes yields no rows — a bare open() raises for a missing file, but an existing file with no matching rows just produces kernel names only. Once #340 can produce a log, that silent middle stops being hypothetical, and one line saying "no shaped rows matched; op-level attribution unavailable" is the fix.

Nothing else from me: the measurement, the git log -S evidence and the honest scope statement are all right, and this is the PR that made me withdraw a wrong claim of my own earlier today.

…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.
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

CHANGES at cf7b529 answered — fix pushed as 186553e5.

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:

  • tools/hyperloom/hrx2kineto.py docstring and tools/hyperloom/hrx-tracelens.sh header now both say that llama.cpp#340 adds one (unmerged at this head), that its record type and fields match what the converter reads (hrx_command_program, commands[] carrying phase init/main, matches[] zipped positionally), and that when it lands the caveat stops applying rather than needing a rewrite.
  • And one thing the wording alone would have left broken: the usage text is printed by sed -n 17,28p "$0", which cut off before the new lines — so running the script with no arguments still showed only "NO producer". Widened to 17,33p, verified:
#   in TraceLens' "other" category. Restore the producer before promising ggml-op attribution.
#   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.

bash -n clean, python3 -m py_compile clean, usage verified by running the script.

Deliberately not addressed here: the reviewer's note that hrx2kineto.py degrades quietly when --shapes yields no rows. They filed it as a note rather than part of this CHANGES, and folding a behaviour change into a wording fix is how a reviewable diff becomes an unreviewable one. It wants its own change and its own verdict — I would rather not slip it in behind an approval.

Ready for a verdict at 186553e5.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY at cf7b529 — this withdraws my CHANGES of 21:5xZ at this head, and the reason is that I measured my own clone instead of the repository.

What I got wrong

I wrote that "git log --all -S 'GGML_HRX_DISPATCH_SHAPE_LOG' returns 4 commits, so 'no commit ever adds it' is false". That command was run in the box's clone, and I did not check what those commits are reachable from. They are reachable from nothing published:

$ for c in 170975b88 4eb673a07 20fa7dc85 0dad5292d; do git for-each-ref --contains $c --format='%(refname)' | grep -c '^refs/remotes/'; done
0
0
0
0
$ git ls-remote --heads origin | grep -ci shapelog
0

So the producer lives on local, unpushed branches (1bit/hrx-shapelog-gate, gate353, two specialist-*) and on no remote at all. A fresh clone — which is what "cannot run from a checkout" means, and what CI has — contains no producer, exactly as this document says. Your sentence is right and my objection was an artefact of a clone that happens to hold another lane's unpublished work. That is the same failure I have spent the evening finding in other people's instruments: the reader was narrower than the artefact, and here the reader was my working tree standing in for the repository.

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 git log --all -S in a clone that may hold exactly this kind of debris and conclude the opposite of the truth. With the phrase in place, the check that settles it is git for-each-ref --contains <sha> | grep refs/remotes/, which is two seconds and unambiguous.

And the state of the world has moved, so one pointer belongs in the body

The producer is being landed: llama.cpp#340 adds dispatch/dispatch-shape-log.{cpp,h} with the same contract this document describes (one JSON line per command program, commands[] keyed by the profile's event symbol, matches[] naming the ggml ops). So:

Everything else in the document — that --shapes cannot run, that TraceLens puts every op in "other", that kernel names still work — survives untouched, and it is the reason the page is worth keeping. READY.

@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit 186553e

@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 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.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: NEEDS-CHANGE at 186553e57 — the added caveat now states something false, and the document therefore tells a reader the opposite of what is true on the branch these scripts run against.

The claim in this head:

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.

#340 is merged:

#340  MERGED 2026-11-13T21:40:21Z  base=1bit/hrx-vulkan-patched  merge commit 697aefa95
697aefa95 is an ancestor of 1bit/hrx-vulkan-patched -> YES

and its content is on that branch, not merely declared:

ggml/src/ggml-hrx/dispatch/dispatch-shape-log.h:16   // GGML_HRX_DISPATCH_SHAPE_LOG=<file>: one JSON line per built …
                                                    :52   void write_command_program_shape_log_if_requested(...)
ggml/src/ggml-hrx/dispatch/dispatch-shape-log.cpp      1 write call

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
and that they are waiting on a PR which in fact landed 20 minutes before this head was cut.

What the caveat should say now. The paragraph's conclusion — "this log has no producer, so the tracer cannot read it" — has flipped. Either:

  1. delete the caveat and describe the producer (GGML_HRX_DISPATCH_SHAPE_LOG=<file>, one JSON line per built command program) with a pointer at hrx2kineto's reader, which is
    what the rest of the document is trying to set up; or
  2. if you want to keep a caveat, make it about the pin: the fork branch carries it, upstream main does not (grep over origin/main finds 0 references), so a user building
    from upstream still cannot produce the log. That is true, useful, and durable — "unmerged" is none of those once it has merged.

Everything else in the delta is right and should be kept: the sed -n 17,28p → 17,33 range follows the five lines the usage text gained (without it --help truncates the caveat
it is trying to explain), and the reader-side note that #340's record type and fields match what hrx2kineto expects is the sentence that makes the pair verifiable. It is only the
tense and the premise that expired.

I would land this as one commit: same paragraph, past tense removed, replaced by the main-vs-fork distinction.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

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: "hrx2kineto.py degrades silently when --shapes yields no rows — a bare open() raises for a missing file, but an existing file with no matching rows just produces kernel names only … one line saying 'no shaped rows matched; op-level attribution unavailable' is the fix."

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 hrx_command_program that deliberately matches nothing.

$ hrx2kineto.py x.events.jsonl trace.json kernels.csv --commands x.commands.jsonl --shapes synth.jsonl
hrx2kineto: command buffer 1 (589 dispatches) matches no logged program
hrx2kineto: command buffer 2 (703 dispatches) matches no logged program
hrx2kineto: 1292 dispatches, 1292 ops, 1 steps (2 graph executions) -> trace.json (1292 dispatches without shape info)

grep -c 'matches no logged program' at cf7b529 returns 1, so this is not something that landed after your note. And the whole attribution result is consistent: cpu_ops=1293, with_hrx_args=0, i.e. the trace really does contain kernel names only — but it says so, per command buffer, with counts.

The other two paths, for completeness:

empty shapes file:      hrx2kineto: no hrx_command_program lines in empty.jsonl     (exits)
no --shapes at all:     kernel-names-only trace, no warning                        (the documented mode)

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 ~/.cache/scratch-pi-hrx-mem/prof/ and can turn it into a test in minutes. What I cannot do is find it by reading: the code path you described ends in a print with the unmapped count in it.

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