4 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
b9acfd47db Merge pull request #1941 from Shashank-Tripathi-07/fix/design-grammar-rewrite-rules-validation
fix(design-grammar): rewrite-rules.yml was never validated at all
2026-07-10 23:43:00 +02:00
Rocky
89653cc726 fix(design-grammar): known_collisions notes cite wrong (row, col) coordinates
7 of 8 documented collision notes cited incorrect (layer, col) coordinates
against the primitives they describe -- off by 1 or more in every case
except #10 Sample. validate.mjs's known_collisions check only verified
that the colliding sym string was present in the list; it never checked
that the ids or descriptive note text actually matched the real
primitives, so this drift was permanently invisible to `make validate`.

Corrected all 4 notes to the actual (layer, col) values from the
primitives list, and added a check that parses "row N col M" per cited id
and cross-checks it against the real primitive data.

Verified: feeding the new regex the original (wrong) note text for #77
and #14 confirms it would have flagged both mismatches; `node
scripts/validate.mjs` passes cleanly against the corrected data.
2026-07-07 13:57:16 +05:30
Rocky
e8cfc8384a fix(design-grammar): rewrite-rules.yml was never validated at all
validate.mjs and build-html.mjs only ever read grammar.yml -- neither
script mentions rewrite-rules.yml anywhere. As a result, two of its rules
already used relieves values outside the file's own declared constraint
vocabulary: prefetching listed "bandwidth stalls" (not a declared
constraint; the file declares "bandwidth") and sparsification listed
"compute" (not declared at all). Any future drift here would have stayed
silent and permanent since nothing ever checked it.

Added a check to validate.mjs that loads rewrite-rules.yml and verifies
every rule's relieves entries are drawn from the file's own declared
constraints list, then corrected the two anomalies: "bandwidth stalls" ->
"bandwidth", and "compute" -> "utilization" (sparsification reduces the
values processed, i.e. relieves compute-utilization pressure -- the
closest existing term in the declared vocabulary).

Verified: `node scripts/validate.mjs` failed with both issues before the
data fix, and passes cleanly after.
2026-07-07 13:54:39 +05:30
Vijay Janapa Reddi
a57c6d7eb9 Introduce ML systems design grammar 2026-05-18 02:06:05 -04:00