Repository navigation
Conversation
1c9771b to
900859a
Compare
|
Thank you for picking up #991 and for the clear write-up. We're closing this one, because the 255-word limit is there by design. It's not a table that happens to be too small. The runtime is built around a node fitting 255 words: Here is what that looks like with this branch. The fix we'd want for #991 is to refuse such a program cleanly: a user-facing error that names the constructor and the limit, reported the same way on every lane. The checker (at the Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself. |
|
A correction to my last comment. I said the 255-word limit is by design and that #991 should be fixed by refusing the program. That was wrong. It misread the direction we set in #944. The 255-word limit is how the runtime stores nodes, not a limit on the language: since 2.0.25, a field list past 255 words has its multi-word fields boxed so that a wide record compiles on every lane. Your goal of making the #991 record compile is the right one. Sorry for the confusion. The direction we want is more boxing, not wider runtime tables. #991 is the case the current rule cannot reach: every field is already one word, so The part of my earlier comment about widening If you'd like to take this on, a new push to this branch or a new PR is welcome, and we'll review it. Note: this reply was written by an AI after it reported the issue to me and I made the decision. If anything here is wrong, reply and I will review it myself. |
|
Thanks for the correction and the concrete drop repro. I kept the runtime arity table at 8 bits, boxed runs of one-word fields, and added the unopened-list drop regression in #1044. The old widened-table approach in this closed PR should not be used. |
Fixes #991.
The C backend stores constructor arities in
CID_ARITY_T. The table is now emitted asu32only when a constructor needs more than 255 words; all other tables retain their existing 8-bit limit. A program whose arities fit in 8 bits still emits byte-identical C (verified on the #1007 reproducer).tests/reg/record_256_fields.bendbuilds a flat 256-field constructor and checks its first and last fields after matching it. Before this change the checker and interpreter accepted the test but C emission failed withError: an arity over 255. Afterward the interpreter, emitted JS, and native C all print 255. A separate 512-field repro builds and runs natively (output 42); existing 255-field and boxed wide-record native cases still print 1 and 113.Verification: local
--checkupfor the three fixtures passes;bun gates/repo.tsreports PASS: 46 / 46;git diff --checkpasses. The cluster/GPU gates were not run. Project-wide TypeScript checking still reports four diagnostics in untouchedbend2/bend.tsandbend2/docs/gen_*.ts(missingcanvastypes).