docs(twitter): add 1688286623375454208 corpus (NOTimothyLottes SPC RDNA2 assembler design)

13-post thread, 12 images. THE RDNA2 ASSEMBLER DESIGN DOC, Aug 2023 -
3 years before the Aug 2025 SPIR-V-from-data work. Same idea, more
concrete, GPU-side assembler+editor building RDNA2 binary for Steam
Deck. Custom binary format (no text input); 32-bit words treated
identically so assembly step is massively parallel. 6-arg symbol
joining + 7th arg for signed 16-bit relative branch offset. 5-char
symbol names (6-bit char table, right-angle-only font, upper case,
some glyph aliasing). SMEM 21-bit offset: 20 bits absolute positive
from KART base, 1 MiB easy data. Source = two 128-bit values per
32-bit word: {RULE, SYMBOLS, RELATIVE BRANCH} and {LABEL, COMMENT}.
3-view editor {symbol, rule, source}, 2 copies of everything per
edit, dead parallel. Interface inspired by MOD-like trackers
(Impulse Tracker): simple {instrument, pattern, arrangement} with
spreadsheet feel. Precursor to the 2079746130309415185 micro macro-
forth and the 1951638140600381942 cart file work.
This commit is contained in:
ed
2026-07-27 01:58:27 -04:00
parent e0c4ef80b7
commit a642db922d
14 changed files with 325 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

@@ -0,0 +1,89 @@
---
title: "Yeah, perhaps wildly alien. But for those who grew up with MOD-like trackers (li"
author: "NOTimothyLottes"
handle: "@NOTimothyLottes"
post_url: "https://x.com/NOTimothyLottes/status/1688286623375454208"
post_id: "1688286623375454208"
timestamp: "2023-08-06 20:31:12"
post_count: 13
reply_count: 0
repost_count: 0
like_count: 7
view_count: 488
---
# @NOTimothyLottes — Yeah, perhaps wildly alien. But for those who grew up with MOD-like trackers (li
## Post 1 (2023-08-06 19:47:57)
SPC: RDNA2 ASSEMBLER [thread] ... Did initial design plan this weekend. The aim is a GPU-side assembler+editor, building RDNA2 binary images for Steam Deck. Live edit, live data view, etc. Assembler and editor running in massive vectorized shader code.
## Post 2 (2023-08-06 19:50:04) — reply to Post 1
Good reason not to use text input for assembler, instead will use a custom binary format, and treat all 32-bit words in the binary the exact same way (so massively parallel assembly step). This is parallel design 101.
## Post 3 (2023-08-06 19:55:06) — reply to Post 2
Some basics: RDNA2 instructions are 1-N 32-bit words. Each of the 32-bit components have a bunch of fields. Will typically need 1-6 fields per 32-bit word, as will be joining some fields into one argument (like DLC/GLC) below.
![Media 1](./media/1688277538571755520_1.jpg)
![Media 2](./media/1688277538571755520_2.png)
## Post 4 (2023-08-06 19:57:16) — reply to Post 3
Could argue that MIMG has the most fields, but in practice many of those fields will be joined (see example), and I'm not likely to be using NSA encoding. So still will only need maximum 6 arguments to build a 32-bit value.
![Media 1](./media/1688278083684421632_1.jpg)
![Media 2](./media/1688278083684421632_2.png)
## Post 5 (2023-08-06 20:00:45) — reply to Post 4
Custom editor, using a custom font, designed for vintage CRTs. Wanted 5-character symbol names for easy packing in 30-bit values. So setup a 6-bit character table. This is using a modified 'right-angle-only' font (like the one below). So some glyphs alias, and only upper case.
![Media 1](./media/1688278959711272960_1.png)
## Post 6 (2023-08-06 20:07:33) — reply to Post 5
Will need some kind of symbol table, what ends up providing the arguments to the rules that build the 32-bit words that comprise the final binary. The symbol indirection provides a way to name registers for example, and then change the register mapping later.
![Media 1](./media/1688280670764756992_1.png)
## Post 7 (2023-08-06 20:09:47) — reply to Post 6
Notice SMEM ops have 21-bit immediate offsets. I'll use 20-bits of that for an absolute positive offset from KART base. 1 MiB of easy data. The editor will relink tagged symbols that represent offsets automatically.
![Media 1](./media/1688281231954161664_1.jpg)
## Post 8 (2023-08-06 20:12:44) — reply to Post 7
Next will need a collection of rules, how to join the 6 possible symbol arguments together. Rules for example for each of the RDNA2 instruction encodings (VOPC, etc). This reduces to just a 6 entry 5-bit left shift amount associated with each argument.
![Media 1](./media/1688281975210041344_1.png)
## Post 9 (2023-08-06 20:15:16) — reply to Post 8
But will need a 7th argument, hard coded to a signed 16-bit *4 relative offset as this is how RDNA2 does all it's relative branches. This will be setup inside the editor to auto relink as source is edited.
![Media 1](./media/1688282613914492928_1.jpg)
## Post 10 (2023-08-06 20:17:11) — reply to Post 9
Source then is simple, two 128-bit values per 32-bit word in the binary. One to select {RULE, SYMBOLS, RELATIVE BRANCH}, and another for {LABEL, COMMENT}.
![Media 1](./media/1688283094049021952_1.png)
## Post 11 (2023-08-06 20:21:08) — reply to Post 10
And then the source editor, shows a line per 32-bit value (so VOP3's for example would take 2 lines). So the 'assembler' is deceptively simple, but powerful enough to do everything required to generate GPU binary code. And all the opcode generation is in the data itself :)
![Media 1](./media/1688284090129084417_1.png)
## Post 12 (2023-08-06 20:24:36) — reply to Post 11
The editor itself will have 3 views {symbol table, rule table, source table}. The editor itself will use 2 copies of everything, so each edit, it's one entry/lane, reading prior state and updating to the new. Dead simple, dead parallel (not necessarily efficient) :)
## Post 13 (2023-08-06 20:31:12) — reply to Post 12
Yeah, perhaps wildly alien. But for those who grew up with MOD-like trackers (like Impulse Tracker below), the interface will almost feel like home (those had simple {instrument, pattern, arangement} editors, with a very spreadsheet feel).
![Media 1](./media/1688286623375454208_1.png)
@@ -0,0 +1,236 @@
{
"root_post_id": "1688286623375454208",
"posts": [
{
"post_id": "1688275737692815360",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "SPC: RDNA2 ASSEMBLER [thread] ... Did initial design plan this weekend. The aim is a GPU-side assembler+editor, building RDNA2 binary images for Steam Deck. Live edit, live data view, etc. Assembler and editor running in massive vectorized shader code.",
"timestamp": "2023-08-06 19:47:57",
"media_urls": [],
"reply_to_id": null,
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 2,
"like_count": 22,
"view_count": 2862
}
},
{
"post_id": "1688276271619248129",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Good reason not to use text input for assembler, instead will use a custom binary format, and treat all 32-bit words in the binary the exact same way (so massively parallel assembly step). This is parallel design 101.",
"timestamp": "2023-08-06 19:50:04",
"media_urls": [],
"reply_to_id": "1688275737692815360",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 3,
"view_count": 193
}
},
{
"post_id": "1688277538571755520",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Some basics: RDNA2 instructions are 1-N 32-bit words. Each of the 32-bit components have a bunch of fields. Will typically need 1-6 fields per 32-bit word, as will be joining some fields into one argument (like DLC/GLC) below.",
"timestamp": "2023-08-06 19:55:06",
"media_urls": [
"https://pbs.twimg.com/media/F232wWkX0AAZWPh?format=jpg&name=orig",
"https://pbs.twimg.com/media/F233F_sWMAAqHBo?format=png&name=orig"
],
"reply_to_id": "1688276271619248129",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 4,
"view_count": 203
}
},
{
"post_id": "1688278083684421632",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Could argue that MIMG has the most fields, but in practice many of those fields will be joined (see example), and I'm not likely to be using NSA encoding. So still will only need maximum 6 arguments to build a 32-bit value.",
"timestamp": "2023-08-06 19:57:16",
"media_urls": [
"https://pbs.twimg.com/media/F233qJyWQAAjmOo?format=jpg&name=orig",
"https://pbs.twimg.com/media/F2333WKXEAAc2fZ?format=png&name=orig"
],
"reply_to_id": "1688277538571755520",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 5,
"view_count": 213
}
},
{
"post_id": "1688278959711272960",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Custom editor, using a custom font, designed for vintage CRTs. Wanted 5-character symbol names for easy packing in 30-bit values. So setup a 6-bit character table. This is using a modified 'right-angle-only' font (like the one below). So some glyphs alias, and only upper case.",
"timestamp": "2023-08-06 20:00:45",
"media_urls": [
"https://pbs.twimg.com/media/F234Y1IXcAECWTB?format=png&name=orig"
],
"reply_to_id": "1688278083684421632",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 4,
"view_count": 221
}
},
{
"post_id": "1688280670764756992",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Will need some kind of symbol table, what ends up providing the arguments to the rules that build the 32-bit words that comprise the final binary. The symbol indirection provides a way to name registers for example, and then change the register mapping later.",
"timestamp": "2023-08-06 20:07:33",
"media_urls": [
"https://pbs.twimg.com/media/F2357mwXUAAC6O6?format=png&name=orig"
],
"reply_to_id": "1688278959711272960",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 4,
"view_count": 182
}
},
{
"post_id": "1688281231954161664",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Notice SMEM ops have 21-bit immediate offsets. I'll use 20-bits of that for an absolute positive offset from KART base. 1 MiB of easy data. The editor will relink tagged symbols that represent offsets automatically.",
"timestamp": "2023-08-06 20:09:47",
"media_urls": [
"https://pbs.twimg.com/media/F236eA_XkAAc8-_?format=jpg&name=orig"
],
"reply_to_id": "1688280670764756992",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 4,
"view_count": 191
}
},
{
"post_id": "1688281975210041344",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Next will need a collection of rules, how to join the 6 possible symbol arguments together. Rules for example for each of the RDNA2 instruction encodings (VOPC, etc). This reduces to just a 6 entry 5-bit left shift amount associated with each argument.",
"timestamp": "2023-08-06 20:12:44",
"media_urls": [
"https://pbs.twimg.com/media/F237AEiWgAAkzD0?format=png&name=orig"
],
"reply_to_id": "1688281231954161664",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 3,
"view_count": 178
}
},
{
"post_id": "1688282613914492928",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "But will need a 7th argument, hard coded to a signed 16-bit *4 relative offset as this is how RDNA2 does all it's relative branches. This will be setup inside the editor to auto relink as source is edited.",
"timestamp": "2023-08-06 20:15:16",
"media_urls": [
"https://pbs.twimg.com/media/F237uqaXAAAKAFl?format=jpg&name=orig"
],
"reply_to_id": "1688281975210041344",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 3,
"view_count": 209
}
},
{
"post_id": "1688283094049021952",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Source then is simple, two 128-bit values per 32-bit word in the binary. One to select {RULE, SYMBOLS, RELATIVE BRANCH}, and another for {LABEL, COMMENT}.",
"timestamp": "2023-08-06 20:17:11",
"media_urls": [
"https://pbs.twimg.com/media/F238Q-zXYAAO1Eo?format=png&name=orig"
],
"reply_to_id": "1688282613914492928",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 3,
"view_count": 194
}
},
{
"post_id": "1688284090129084417",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "And then the source editor, shows a line per 32-bit value (so VOP3's for example would take 2 lines). So the 'assembler' is deceptively simple, but powerful enough to do everything required to generate GPU binary code. And all the opcode generation is in the data itself :)",
"timestamp": "2023-08-06 20:21:08",
"media_urls": [
"https://pbs.twimg.com/media/F238wJ8WoAAtEfw?format=png&name=orig"
],
"reply_to_id": "1688283094049021952",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 4,
"view_count": 286
}
},
{
"post_id": "1688284962288537600",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "The editor itself will have 3 views {symbol table, rule table, source table}. The editor itself will use 2 copies of everything, so each edit, it's one entry/lane, reading prior state and updating to the new. Dead simple, dead parallel (not necessarily efficient) :)",
"timestamp": "2023-08-06 20:24:36",
"media_urls": [],
"reply_to_id": "1688284090129084417",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 3,
"view_count": 484
}
},
{
"post_id": "1688286623375454208",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Yeah, perhaps wildly alien. But for those who grew up with MOD-like trackers (like Impulse Tracker below), the interface will almost feel like home (those had simple {instrument, pattern, arangement} editors, with a very spreadsheet feel).",
"timestamp": "2023-08-06 20:31:12",
"media_urls": [
"https://pbs.twimg.com/media/F23_OOhXgAUBtlb?format=png&name=orig"
],
"reply_to_id": "1688284962288537600",
"quote_of_id": null,
"metrics": {
"reply_count": 0,
"repost_count": 0,
"like_count": 7,
"view_count": 488
}
}
],
"source_url": "https://x.com/NOTimothyLottes/status/1688286623375454208"
}