Skip to content

Fix storage element type check and FES parameter data for createStorage/buildComputeShader - #9355

Merged
davepagurek merged 2 commits into
processing:mainfrom
aashu2006:fix/storage-element-type-check
Oct 29, 2026
Merged

davepagurek merged 2 commits into
processing:mainfrom
aashu2006:fix/storage-element-type-check

Conversation

@aashu2006

Copy link
Copy Markdown
Member

This is a follow up to #9083, I found this while testing v2.4.0-rc.2

The mismatch warning from #9083 never actually fired. #9086 widened the storage regex for StorageList, so it now grabs the whole type like array<atomic<u32>> instead of just atomic<u32>, and the type lookup returned nothing. My old tests mocked the parsed object so they missed it.

Fixed it by unwrapping array<T> / array<T, N> to get the element type. once that worked, StorageLists in render shaders started hitting the check and crashed since they don't have _arrayType, which broke instances(storageList). Lists only hold floats or structs so the check just skips them now.

Also parameterData.json was never regenerated after #9083, so createStorage(new Uint32Array(...)) gave a false FES warning. And buildComputeShader() only listed a function param, so the hooks object form from the reference logged a raw zod error. I added the missing overloads and updated just those 3 entries

I also added the "Storage element type check" suite that goes through the real shader parsing

PR Checklist

@p5-bot

p5-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown

Continuous Release

CDN link

Published Packages

Commit hash: 4dc5a53

Previous deployments

This is an automated message.

@davepagurek davepagurek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this, the change looks good to me.

Just thinking through some next steps for this atomic system: right now we don't handle wgsl struct arrays that have atomics in them, right? And in struct data coming from js, we never get atomics because there's no js equivalent, so that would just be an issue for manually-written WGSL code? Possibly some next steps would eventually be to handle atomics inside structs, and think of a way to do all these things in js strands.

@davepagurek
davepagurek merged commit 327c20b into processing:main Oct 29, 2026
4 checks passed
@aashu2006

Copy link
Copy Markdown
Member Author

yeah that's right @davepagurek , struct arrays like array just get skipped by the check since the element type isn't f32/u32/i32, and struct data from js is always packed as floats so u would only hit this with handwritten wgsl that puts an atomic in a struct

atomics inside structs + a strands way to do it seems a good next step. StorageList already generates an atomic length inside a struct, so there is kind of a pattern to build from there.

let me know I will create an issue for the same.

@davepagurek

Copy link
Copy Markdown
Contributor

sure, we can make issues, although also no rush right now -- if it's a task you're interested in working on but don't have the bandwidth yet it's also ok to wait a bit until you do. we'll be busy with 2.4 things for a little bit anyway 🙂 (If it's something you want to work on now or open up to the community to work on we can do issues now too!)

@aashu2006

Copy link
Copy Markdown
Member Author

yes let’s wind up 2.4 properly first. I’ll start looking into atomics in structs after that.

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.

2 participants