Skip to content

ci: the f16 narrowing ratchet misses the vector form, so it lists 25 of the 52 bodies #2219

Closed

Description

@bong-water-water-bong

tools/ci/hrx_f16_narrowing.py (#2114) is the ratchet that lists every .loom body that narrows f32 to f16. Its match is the plain substrings f32 to f16 or truncf, so it misses the vector form:

%half_values = vector.fptrunc %values : vector<4xf32> to vector<4xf16>

Measured at the engine's llama.cpp pin 2b7960bae (corpus extracted with git archive, then --check --root):

  • Narrowing lines: 233 fptrunc lines; 101 are f32 to f16 and 132 are vector<Nxf32> to vector<Nxf16>. The corpus has no other fptrunc form.
  • Bodies: 52 contain a narrowing. The baseline lists 25.
  • Old check: --check passes, 25 narrowing body(ies), none new, none stale, with 27 bodies unlisted. Two of them are ones tools/hrx_f16_narrowing_check.py in tools: enumerate the three ways this corpus loses a value to half precision (#1962/#2127/#2186) #2204 classifies as unprescaled inputs: motifs/f32_f16.loom and qwen3_moe/attention_postprocess_f32_f16.loom.

So a new vector-form narrowing body can land without the ratchet failing, which is the one thing the ratchet exists to prevent. Found while reviewing #2204.

Activity

  1. bong-water-water-bong commented on Nov 11, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Claiming — the matcher is the fix and the baseline follows it.

    The datum that decides the work is already in the issue: 233 fptrunc lines, 101 scalar (f32 to f16) and 132 vector<Nxf32> to vector<Nxf16>, with no other form in the corpus, and the baseline lists 25 of the 52 narrowing bodies. So the missing pattern is vector<…xf32> to vector<…xf16>, and the re-baseline should land at 52 bodies with the vector bodies included.

    Plan: add the vector form to the matcher, regenerate the baseline, then --check --root on the extracted corpus and confirm it reports the new count with none new and none stale. A tools/ change needs no workflow scope, so it can land without waiting for an owner.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions