Make AddCarry available in Pancake#1398
Conversation
Assisted-by: Claude:claude-opus-4-7
- Add NOT_MEM_FLOOKUP_ZIP to misc - Add FLOOKUP_set_globals as simp - Rewrite unassigned_free_vars_evaluate_same
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Fresh checkout so we can implement Primitive cleanly
Assisted-by: Claude-claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Claude figured out that it needed that tactic, but somehow broke down trying to actually implement it. Assisted-by: Claude:claude-opus-4-7
Once again, Claude was close, but then got confused. Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Also removed add-with-carry support at tail calls.
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Register can be clobbered, so we use (odd) scratch registers. Assisted-by: Claude:claude-opus-4-7
- locals_rel ensures that we have even numbers now (needed to use odd numbers as scratch registers) - Start of proof for Primitive case Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
Assisted-by: Claude:claude-opus-4-7
|
If you have time @halogentlepersuasion , perhaps it would be good if you took a look at whether the changes to panStatic are alright. |
talsewell
left a comment
There was a problem hiding this comment.
Looks generally OK. A few of the proofs seem a bit verbose, suggesting that "Primitive" is one of the medium-tricky constructs, when it seems on the easier side.
I suspect word_and_carry should be word_add_carry?
I'm a bit confused why the patch moves shape_val up to panLang, maybe there's a new use for it somewhere I missed.
I think I understand the bit about carrying the distinctness down from other layers better now. One option for that is to put it in the semantics: have the loop (and maybe crep) semantics fail if you try to provide overlapping register arguments to Primitive. But yeah, using funny-numbered temporaries does seem like a reasonable strategy.
|
Thanks for the review!
I suspect part of the reason is that some of the proofs are generated by Claude. When things looked extra sketchy, I went over it myself/told it to clean up, but perhaps I missed some cases. In particular, it seems that Claude liked to do a lot of Another reason for the verbosity could be that Either way, if there is something especially suspicious, please let me know.
Indeed, thanks for catching that. I will fix that. Goes to show that I don't need AI to add mistakes to my PRs 🫠
I think that was from the version that added |
Thanks to @talsewell for catching this.
Sure thing, here's everything I noticed. For
For
Also, add an example directly in the Otherwise, the changes seem functional :) |
I think this is best explained by the addition in the examples:
This is achieved by adding a Primitive node throughout the Pancake layer, which is essentially handed down as is down to wordLang. Some noteworthy things:
numsstarting fromcrep)AddCarryinwordLangoverwrites the arguments, aliasing is a bit problematic. I think one could end up transporting the fact that all names are distinct from the earlier layers, but I ended up extendinglocals_relinloop_to_wordProofto mention the fact that numbers are even, so we can make use of the odd numbers as scratch space