Skip to content

Conversation

@svishnus
Copy link
Collaborator

@svishnus svishnus commented Sep 23, 2025

  • Added some comments on where spork gets added as a prim and lowered into IR
  • Created a unified interface for unrolled and regular loops in ForkJoin
  • Remove sources.mlb (used for millet-ls) in the end
  • Spork_Prim now gets a boolean attribute isLoop which can be observed by the compilation pipeline
  • We are instead going with spork_choose loopBody unrolledThunk() regularThunk()
  • Need to make sure spork/spoin nesting depth isn't getting messed up
  • Think of introducing management of spareHeartbeatTokens and .hasEnoughToSpawn checks in the compiler -> remove from Scheduler.sml

NOTE: Can we ever get a loopy spork from a non-loopy initial call?

  • Answer is yes, examples in loopy sporks notion page

@svishnus svishnus requested a review from shwestrick September 23, 2025 20:59
@svishnus svishnus self-assigned this Sep 23, 2025
@svishnus
Copy link
Collaborator Author

svishnus commented Oct 6, 2025

Introduced the new spork_choose prim at this point, which I'm trying to handle during closure-convert. I still don't fully understand what's going on. Compile errors are fixed, but there is some obviously wrong abstract value management happening.

@svishnus
Copy link
Collaborator Author

We have a basic threshold-based logic that counts the number of sxml decs in a loop body and decides to apply the optimization if loopBodySize < threshold (currently at 100). NOTE: This does not account for nested sporks . We also don't do any sort of weighted sum based of distinct weights per specific type of sxml dec.

- now, the integer precision check should be done statically using the
  WordImpl and ManagedLoops using `Int_ChooseFromInt`
- abstracted out `LoopIndex` part into different file and added it to
  sources
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