Skip to content

inter-target ordering - #73

Draft
pufferfish101007 wants to merge 17 commits into
mainfrom
order!
Draft

pufferfish101007 wants to merge 17 commits into
mainfrom
order!

Conversation

@pufferfish101007

@pufferfish101007 pufferfish101007 commented Sep 4, 2026

Copy link
Copy Markdown
Member

very very WIP, nowhere near ready. creating a PR to make a note of what needs to be done.

will resolve #59

Changes

  • driveby: represent WASM types as rust types 👀
  • driveby: create a resizeable/dynamic array type for wasm - this means that threads are no longer limited to a stack size of 8 (will hopefully get rid of some nullpointerexception errors)
  • driveby: update wasm nightly version
  • driveby: uodate wasm-tools deps
  • replace global threads table with an array of arrays of threads, with one array per target

Still TODO

  • Finish implementing mutually recursive type registration
    • need a new IntraRecGroupInfo or similar context in which to register RecGroupDependencies
    • add new CompoundType for a rec group item so that rec group registrations have a canonical representation and can be registered uniquely
    • handle transformation from rec group CompoundType to actual WASM type - need to encapsulate into a real rec group to reference type indices greater than the current one.
  • make type registration handling somehow detect when a type declared outside of a rec group should be structurally equivalent to one inside the rec group, and somehow elide the registration of the former in favour of the latter. e.g. TStackArray vs TDynArray<TStackStruct>
    • n.b. registering the non-rec-group one first is fine, because it will depend on the rec group and so the rec group will be present
    • add PartOfRecGroup trait or similar, then if deps include that (by Filter), register deps then search in returned rec group for correct shape
  • distinguish between same-shaped rec group members in different rec groups (because TRecGroupItem<0> could refer to totally different types in different rec groups)
  • encapsulate StaticFunctionRegistry "overrides" within the finishing of the registry, rather than the WasmProject needing to call each one out individually. Particularly important for handling DyanmicArray*<T> ops because you can't know what'll be registered in advance
    • Add some sort of dependency handling to StaticFunctionRegistry so that static functions can register other funvtion at finish/registration time
  • adapt remaining instructions & functions to use new thread layout
  • implement layer-related blocks
  • split tyfp into a separate crate? or make more minimal :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inter-target execution order / layers

1 participant