Conversation
plajjan
reviewed
May 29, 2026
nordlander
reviewed
Jun 3, 2026
Contributor
nordlander
left a comment
There was a problem hiding this comment.
Looks good to me! (The complexity of CodeGen had grown large long before this PR...)
Contributor
|
FYI; I will take over this branch, rebase it etc - I noticed there are a few small mistakes, more technical in nature that I think come from rebasing issues or similar. I will clean up that as well as updating goldens etc to make sure the tests passes. Thanks for the fantastic work :) there will be downstream dependencies to be updated in all libraries that do C bindings basically - I will fix those too in time... |
…ll standard library files; all generated C files compile without errors. Some tests in test suite do not work.
…test in test_acton
UnitTest.run_test discarded the test function's return value, so unit test snapshot output was always None and mismatches went undetected.
Bounded ints/floats now use raw scalar representations; bigints stay boxed with Number witnesses. Regenerated boxing and codegen goldens.
dotCast passed a substituted general type to matchTypes, collapsing an abstract return tyvar (e.g. Number.real : () -> Real) to its unboxable instantiation and emitting a raw-double cast on a vtable slot that returns a boxed $WORD. Pass the uninstantiated general type so abstract positions stay boxed. Restores test_complex.act since it now works again.
The generated __deserialize__ for unboxed int/float fields copied the field into the temporary instead of the reverse, so the deserialized value was discarded and the field was never restored. It also used sizeof($WORD), which would overflow sub-64-bit fields. Write the value back with memcpy(&self->i, &tmp, sizeof(self->i)), matching the RTS's hand-written $val_deserialize usage and preserving float bit patterns. Fixes corrupt resumed actor state, which surfaced as "Error unpacking client message, msg is NULL" in the DB resume tests. Regenerated the affected codegen goldens.
The methodCast change (d21aa73) casts method-table function pointers to the table slot's ABI shape but did not refresh the codegen goldens. Mechanical regeneration of ints/deact/lines; no compiler change.
genEnter/genDotCall now wrap the receiver in genReceiver, casting it to its boxed type before ->$class. Fixes "member reference base type 'void'" when the receiver is an untyped $WORD, e.g. a tuple component used as a method receiver (pipes.client.write(...)). Also refactors initClassBase's inherited-attribute casting to reuse methodCast, and adds the indexedKWs helper. Extracted from a combined commit; its unrelated build.zig std-option change is dropped (that error was a build-state artifact, not needed).
added 2 commits
June 4, 2026 10:11
The boxing pass can see zero-argument __bool__ calls on numeric values whose receiver has already been lowered to an unboxed representation. The generic method-call path leaves that as a Dot on a raw receiver, which QuickType cannot schema and which caused http2.client to fail on an UNBOXED u32 receiver. Handle that case during boxing by lowering numeric truthiness directly to a raw nonzero comparison. The comparison stays in the unboxed representation, and only the resulting Acton bool is boxed for the surrounding expression.
The std copy of math still used the older RealFuns witness wrapper while base had moved to direct float functions. That left std.math out of step with the unboxed math ABI used on this branch. Copy the simplified math.act shape from base and keep only the std module symbol prefix in math.ext.c. The exported C functions now use raw double arguments and results like the base module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First version with total unbox of bounded ints and floats