Repository navigation
feat(flow-symbols): a ram, the memory behind its interface - #267
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 hadmemory(the interface that loads and stores go through),load,storeandload-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
loadand astorecarry, alone and longer (at most twice as long), then the shape in the value font, as amemoryshows it. A reader who knows the stack from a load sees the same thing without the arrow.max(32, text + 12)across. To the right it is one frame across andmax(32, text + 28)along. With no text, or a blank one, it saysram.flow-thinare there already, soflow-symbols.cssandflow-symbol-views.tsdo not change.Why a kind of its own and not
memorywith a textA 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.
memoryalso 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. AlsotextOf, from the review: a number in atext, aglyph, amarkor atois read as its digits, and any other value that is not a string counts as one not given. A number intextsized a ram, a memory, a constant or an instance at NaN, and a number intothrew. 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 typecheckpasses, with the strict client check that a product runs.npm run check:neutralitypasses, 5 of 5 gates.memory,load,storeandload-store-queuein 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.
?), 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:cutandtextWidthcount UTF-16 units for every kind, and a shape text is digits,×and a type name.https://claude.ai/code/session_01EToj6NxqLABK3H5cucHNsY