Codex/generic closures#2835
Open
sydow wants to merge 42 commits into
Open
Conversation
…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.
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.
Experimental branch which aims at reducing C file size by generating fewer closure classes. Instead we define a small number of structs in base/builtin/closures.c (and .h). The effect is that the total size of C code in acton/dist/base/out/types/ has decreased from 4.08 MB to 3.24 MB; from 72339 lines till 55021, thus in both measures a decrease of ca 25%. The closures.c/h files are together ca 300 lines. Uncommon and/or complicated closures (e.g. with many properties) are treated as before.
Not intended for merge now. Depends on new-unbox. Initial golden tests will fail.