mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-15 21:28:33 -05:00
[PR #1941] [MERGED] fix(design-grammar): rewrite-rules.yml was never validated at all #34665
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1941
Author: @Shashank-Tripathi-07
Created: 7/7/2026
Status: ✅ Merged
Merged: 7/10/2026
Merged by: @profvjreddi
Base:
dev← Head:fix/design-grammar-rewrite-rules-validation📝 Commits (1)
e8cfc83fix(design-grammar): rewrite-rules.yml was never validated at all📊 Changes
2 files changed (+24 additions, -2 deletions)
View changed files
📝
design-grammar/rewrite-rules.yml(+2 -2)📝
design-grammar/scripts/validate.mjs(+22 -0)📄 Description
Summary
validate.mjsandbuild-html.mjsonly ever readgrammar.yml-- neither script mentionsrewrite-rules.ymlanywhere. Any drift in that file stays silent and permanent.relievesvalues outside the file's own declared constraint vocabulary:prefetchinglisted"bandwidth stalls"(the file declares"bandwidth", not that phrase) andsparsificationlisted"compute"(not declared at all).Fix
validate.mjsthat loadsrewrite-rules.ymland verifies every rule'srelievesentries are drawn from the file's own declaredconstraints:list."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).Test plan
node scripts/validate.mjsfailed with both issues before the data fix:✓ grammar.yml is valid, 90 primitives, 51 assemblies, 0 issues).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.