Skip to content

feat(flow-symbols): a ram, the memory behind its interface - #267

Merged
endrix merged 3 commits into
mainfrom
feat/flow-symbol-ram
Dec 2, 2026
Merged

endrix merged 3 commits into
mainfrom
feat/flow-symbol-ram

Conversation

@endrix

@endrix endrix commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

A 29th flow symbol, ram, in the memory family. It is for a node that is a memory itself, with no operand and one result. A product had memory (the interface that loads and stores go through), load, store and load-store-queue, and nothing for the memory those sit in front of.

This is the Dialogram part of a follow-up to the handshake pictograms (#262). The MLIR language server now says {"symbol": "ram", "text": "64×i10"} for such an op (streamblocks-mlir #537), and mlir-viewer follows.

The drawing

  • The stack of three thin lines that a load and a store carry, alone and longer (at most twice as long), then the shape in the value font, as a memory shows it. A reader who knows the stack from a load sees the same thing without the arrow.
  • The body starts at the edge, as the body of a plain constant does, because nothing comes in. One stub leaves the output edge.
  • The lines turn with the flow as those of a load do. The text stays upright.
  • Down the page it is one frame (32 units) along the flow, as the load, the store and the constant beside it are, and max(32, text + 12) across. To the right it is one frame across and max(32, text + 28) along. With no text, or a blank one, it says ram.
  • No new colour and no new class. The red tint of the memory family and flow-thin are there already, so flow-symbols.css and flow-symbol-views.ts do not change.

Why a kind of its own and not memory with a text
A memory and its interface show the same shape. One drawing for both would put two alike boxes on one wire, and a reader could not tell the storage from the unit in front of it. memory also keeps faint lines on its input and output sides for its many pins, and a ram has one pin.

What changes

  • packages/shared/src/flow-symbols.ts: the kind, its family, its counts ([0, 0, 1, 1]) and its definition. Also textOf, from the review: a number in a text, a glyph, a mark or a to is read as its digits, and any other value that is not a string counts as one not given. A number in text sized a ram, a memory, a constant or an instance at NaN, and a number in to threw. No drawing of a well-formed depiction changes, an empty text included.
  • packages/diagram-client/test/flow-symbols.test.ts: 29 kinds, the ram in the tables the generic tests walk, a test of the ram (one pin on the output edge, three words longer than in a load and at most twice as long, the text and its cut, the turn with the flow, the one frame down the page, the counts it refuses), and a test that gives every text field a number and values of other wrong types.
  • CHANGELOG.md: the kind under Added, the text fields under Fixed.

Checks

  • npm test: 147 + 140 + 80 + 81 test files pass (1106 + 1196 + 841 + 652 tests). The two new tests fail on the first commit of this PR and pass on the last.
  • npm run typecheck passes, with the strict client check that a product runs.
  • npm run check:neutrality passes, 5 of 5 gates.
  • For the 28 kinds of main, in both directions, with 0 to 6 operands and results and a set of texts (the empty one included), the spec of this branch equals the spec of main: 96040 compared, 19880 of them drawn, none differs. The script is not in the repository.
  • I drew the ram beside memory, load, store and load-store-queue in both directions with the colours of a dark and of a light theme, and looked at it, before and after the review. Four drawings were tried (rows that fill the body, the same rows kept upright, a grid band, the stack of a load). The stack of a load reads as part of the family, and the rows read as a buffer with slots.

Review
Two rounds at medium.

  • First round, five findings, all taken in the second commit: a text that is not a string, an empty text, the 36 units along where one frame does, a test that did not check what it said, and the changelog.
  • Second round, four nits and one note on code that was there before. Taken in the third commit: a number is read as its digits (it had become ?), an empty text stays a text for the kinds that had one (the first round had made them fall back), and the mark of a compare is in the test. Not taken: the counts of a ram stay [0, 0, 1, 1], since the op the server marks (handshake.ram) has no operand and one result by its definition and its verifier. Left as it was: cut and textWidth count UTF-16 units for every kind, and a shape text is digits, × and a type name.

https://claude.ai/code/session_01EToj6NxqLABK3H5cucHNsY

A 29th kind, `ram`, in the memory family: the memory itself, with no
operand and one result. It is drawn as the stack of three thin lines that a
load and a store carry, alone and longer, with its shape after it, in a
body that starts at the edge because nothing comes in. The lines turn with
the flow as those of a load do, and the text stays upright.

It is a kind of its own and not `memory`: `memory` draws the interface
that the loads and the stores go through, and a memory and its interface
show the same shape, so one drawing for both would put two alike boxes on
one wire.

Down the page it is 36 along and as wide as its text needs. To the right
it is one frame across and as long as its text needs. No new colour and no
new class: the family tint and `flow-thin` are there.

Claude-Session: https://claude.ai/code/session_01EToj6NxqLABK3H5cucHNsY
…the changelog

- Down the page the ram is one frame along the flow, as the load, the
  store and the constant beside it are. It was 36, copied from `memory`,
  with nothing that needed the room. To the right its shape still takes
  its room along the flow.
- A `text`, a `glyph`, a `mark` or a `to` that is not a string, or is
  empty, counts as one not given (`textOf`). A number in `text` sized a
  ram, a memory, a constant or an instance at NaN, and a number in `to`
  threw. An empty text on a ram left it without a label.
- The test of the ram checks what it says: a word longer than in a load
  and at most twice as long, the cut at sixteen characters, the one frame
  down the page. A second test gives every text field a value of the
  wrong type.
- CHANGELOG: the kind under Added, the text fields under Fixed.

Claude-Session: https://claude.ai/code/session_01EToj6NxqLABK3H5cucHNsY
…y text stays

- `textOf` reads a number where a text goes as its digits, so a constant
  sent as `64` still shows 64. Any other value that is not a string counts
  as none given.
- An empty string is a text again for every kind that had one before: a
  constant, an instance, a memory and a sign draw it as they did. The first
  round had made them fall back, which changed drawings this PR does not
  mean to touch. The ram alone says `ram` for an empty or a blank shape.
- The test covers the mark of a compare, the digits, and the empty text.
- Checked outside the tests: for the 28 kinds of main, in both directions,
  with 0 to 6 operands and results and a set of texts (the empty one
  included), 96040 specs are the same on main and on this branch.

Claude-Session: https://claude.ai/code/session_01EToj6NxqLABK3H5cucHNsY
@endrix endrix closed this Dec 2, 2026
@endrix endrix reopened this Dec 2, 2026
@endrix
endrix merged commit c4934f9 into main Dec 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant