Files
ed 60231356bb docs(twitter): add 1870351985855119449 corpus (NOTimothyLottes STORAGE_TEXEL_BUFFER aliasing)
18-post single-author technical walkthrough, 6 PNGs. Defines streaming
qualifier alphabet (W=writeonly coherent, R=readonly, A=atomics,
E=streaming readonly/exclusive, F=streaming writeonly/final) for
future-compat code even though Vulkan is missing them. Only 32/64/128-
bit type descriptors kept; type aliasing for fast path, explicit
type only when buffer compression might help someday. No 16-bit
<U,S>NORM, no 9E5/sRGB buffer access. AMD buffer atomics get signage
from opcode so UINT32 TEXEL buffer can alias r32ui/r32i. Few hundred
macros for STB access. Continuation of the bind-everything-once
engine cleanup.
2026-07-27 01:45:02 -04:00

306 lines
11 KiB
JSON

{
"root_post_id": "1870351985855119449",
"posts": [
{
"post_id": "1870342724538204320",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Hopefully with this last atomic workaround I'm almost done with cleaning and fixing the 'bind-everything-once' style Vulkan engine design. Work in progress in the images that follow. Setting up the macros to get all the format aliasing is well quite ugly.",
"timestamp": "2024-12-21 05:37:09",
"media_urls": [
"https://pbs.twimg.com/media/GfTKfZpWMAAifu3?format=png&name=orig"
],
"reply_to_id": null,
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 11,
"view_count": 1334
}
},
{
"post_id": "1870342953996288347",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "I end up doing a lot of duplication via macros since memory qualifiers are on the layout aliasing (instead of an argument to the operation like they should be) ...",
"timestamp": "2024-12-21 05:38:04",
"media_urls": [],
"reply_to_id": "1870342724538204320",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 0,
"view_count": 147
}
},
{
"post_id": "1870343645926224197",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Vulkan is missing the streaming qualifiers, but I write the code like they exist for future compat\nW ... writeonly coherent (all writes)\nR ... readonly (all reads)\nA ... coherent (atomics)\nE ... streaming readonly (aka [E]xclusive)\nF ... streaming writeonly (aka [F]inal)",
"timestamp": "2024-12-21 05:40:49",
"media_urls": [],
"reply_to_id": "1870342953996288347",
"quote_of_id": null,
"metrics": {
"reply_count": 2,
"repost_count": 0,
"like_count": 0,
"view_count": 180
}
},
{
"post_id": "1870344199599480840",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "",
"timestamp": "2024-12-21 05:43:01",
"media_urls": [
"https://pbs.twimg.com/media/GfTMGj2WcAAoneG?format=png&name=orig"
],
"reply_to_id": "1870343645926224197",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 0,
"view_count": 126
}
},
{
"post_id": "1870344537027092983",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Texture layout aliasing is well the easy stuff since it's just readonly effectively",
"timestamp": "2024-12-21 05:44:21",
"media_urls": [
"https://pbs.twimg.com/media/GfTMbIVXEAAqSaA?format=png&name=orig"
],
"reply_to_id": "1870344199599480840",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 0,
"view_count": 135
}
},
{
"post_id": "1870345116373676163",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "STORAGE_TEXEL_BUFFER is well complex for aliasing and how to best use. Here is what I'm doing for setup (macro heavy). I have a define for each format descriptor index if I want to reorder them by usage for better cache layout. I only keep 32/64/128 bit types",
"timestamp": "2024-12-21 05:46:39",
"media_urls": [
"https://pbs.twimg.com/media/GfTM36hXwAANxQl?format=png&name=orig"
],
"reply_to_id": "1870344537027092983",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 1,
"view_count": 146
}
},
{
"post_id": "1870345417587614054",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "I didn't put in support for 16-bit <U,S>NORM yet because it tends not to get used (bad match for FP16). Likewise no buffer access to 9E5 or sRGB due to HW portability support issues",
"timestamp": "2024-12-21 05:47:51",
"media_urls": [],
"reply_to_id": "1870345116373676163",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 0,
"view_count": 107
}
},
{
"post_id": "1870346478729765374",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "So todays HW\n(1.) At least for AMD buffer atomics get the signage from the OPCODE so in theory one can use a UINT32 typed TEXEL buffer with both aliased as r32ui and r32i",
"timestamp": "2024-12-21 05:52:04",
"media_urls": [
"https://pbs.twimg.com/media/GfTOBhyWEAAmNzY?format=png&name=orig"
],
"reply_to_id": "1870345417587614054",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 0,
"view_count": 129
}
},
{
"post_id": "1870346962945359928",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "(2.) No buffer compression HW, so unlike images, there is no point in using separate types if the layout aliasing trick works. One could get by with just 32/64/128 bit type descriptors and extra ones for anything with format conversion",
"timestamp": "2024-12-21 05:53:59",
"media_urls": [],
"reply_to_id": "1870346478729765374",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 1,
"view_count": 103
}
},
{
"post_id": "1870347429104492943",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "(3.) In cases like <FP16,UINT16>x<2,4> actually probably better to alias those at UINTx<1,2> because then one is sure the compiler doesn't screw up the implicit NOPing of the undo the the format conversion!",
"timestamp": "2024-12-21 05:55:51",
"media_urls": [],
"reply_to_id": "1870346962945359928",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 1,
"view_count": 85
}
},
{
"post_id": "1870348327763542515",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "(4.) There is a strong desire to keep the number of descriptors down to avoid extra work in SMEM ops and extra SGPR pressure. So that also favors aliasing.",
"timestamp": "2024-12-21 05:59:25",
"media_urls": [],
"reply_to_id": "1870347429104492943",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 1,
"view_count": 78
}
},
{
"post_id": "1870348575181295969",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "(5.) Ideally I'd want TBUFFER support with the HW grabbing the index width from the type in the opcode instead of the descriptor (but I don't think the HW does that, so probably would always need 3 descriptors minimum).",
"timestamp": "2024-12-21 06:00:24",
"media_urls": [],
"reply_to_id": "1870348327763542515",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 0,
"view_count": 82
}
},
{
"post_id": "1870349164405567671",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "(6.) The future? Image compression relies on having the right type info in the descriptor to choose the right compression mode for decorrelation of the data. What happens if GPUs get buffer compression some day and everyone is just type aliasing all the time like SSBOs do?",
"timestamp": "2024-12-21 06:02:44",
"media_urls": [],
"reply_to_id": "1870348575181295969",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 0,
"view_count": 103
}
},
{
"post_id": "1870349929136201894",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "(7.) What is the \"right answer\"? Even signed vs unsigned could be important for data decorrelation. Certainly float vs int is. But no one wants to burn perf today based on a guess of what is needed in an unknown future.",
"timestamp": "2024-12-21 06:05:47",
"media_urls": [],
"reply_to_id": "1870349164405567671",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 0,
"view_count": 82
}
},
{
"post_id": "1870350304878711133",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "(8.) So my compromise is to have all the types, but write the code to use type aliasing (the fast path on todays HW) when I don't think data compression would help. And only use the right type (slower) if there is a prediction it might help some day if buffer compression shows up",
"timestamp": "2024-12-21 06:07:16",
"media_urls": [],
"reply_to_id": "1870349929136201894",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 0,
"view_count": 109
}
},
{
"post_id": "1870350758744363037",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "(9.) In cases where I need compression today, then I use explicit 2D images (assuming 1D images don't get compression on some HWs). But note this is not great, because often I need that data back in SGPRs (expensive, SMEM doesn't to image loads)",
"timestamp": "2024-12-21 06:09:04",
"media_urls": [],
"reply_to_id": "1870350304878711133",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 0,
"view_count": 141
}
},
{
"post_id": "1870351434216329453",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Combining the STORAGE_TEXEL_BUFFER tricks (for something a good compiler could optimize from last week or so), I'm down to a few hundred macros for STB access. Showing a few here. It's ugly but the only way to actually implement well.",
"timestamp": "2024-12-21 06:11:46",
"media_urls": [
"https://pbs.twimg.com/media/GfTSkwZWIAAgV-q?format=png&name=orig"
],
"reply_to_id": "1870350758744363037",
"quote_of_id": null,
"metrics": {
"reply_count": 1,
"repost_count": 0,
"like_count": 1,
"view_count": 551
}
},
{
"post_id": "1870351985855119449",
"author": "NOTimothyLottes",
"handle": "NOTimothyLottes",
"text": "Not sure if this is the end of this story yet, but hopefully the holidays I get this back online and can get back to using it. Probably have it down to as optimal as it can get while being as portable and future looking as possible",
"timestamp": "2024-12-21 06:13:57",
"media_urls": [],
"reply_to_id": "1870351434216329453",
"quote_of_id": null,
"metrics": {
"reply_count": 0,
"repost_count": 0,
"like_count": 2,
"view_count": 441
}
}
],
"source_url": "https://x.com/NOTimothyLottes/status/1870351985855119449"
}