AIGEN: Fix iterator compilation bug with value class field access (#769)#1077
AIGEN: Fix iterator compilation bug with value class field access (#769)#1077mbouaziz wants to merge 2 commits into
Conversation
|
This PR was created using no other guidance than "Fix #769" |
56c71a9 to
77317fa
Compare
Did you review it? |
|
I did review but I didn't take time to collect enough context to understand it deeply. |
77317fa to
3acdd84
Compare
CI setup for this PRThis PR includes a temporary second commit that:
This allows CI to run the full test suite using a compiler that includes the fix, verifying end-to-end correctness. Before merging, the second commit ( Local verification results
|
jberdine
left a comment
There was a problem hiding this comment.
Code change LGTM.
It would be a good idea to fully redo the test after rebasing.
bc8a01d to
56bb92c
Compare
Redo after rebase (2026-07-02)Rebased onto current main (was 653 commits behind; clean rebase). Re-reviewed the diff and tightened the comment in CI setup for this PR (updated)The temporary CI commit is simpler than before: it only points the CI jobs at fresh
STAGE=1 bin/docker_build.sh --push --arch amd64 skiplang skip skdb-base -- \
--set skiplang.tags=skiplabs/skiplang:fix-769 \
--set skip.tags=skiplabs/skip:fix-769 \
--set skdb-base.tags=skiplabs/skdb-base:fix-769Before merging: drop the |
The compiler was incorrectly marking code as unreachable when accessing fields of value classes (like Some<T>.value) if the field type appeared as unresolved type `_` during compilation. This happened with lazy iterator chains using flatMap and filter with yield. The fix moves the canInstantiate check inside the NamedLeaf branch only (for reference classes which require scalarization), allowing value class field access to proceed without this check since it's just bookkeeping. This removes the .collect(Array) workaround in SqlSchemaMigration.sk. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Temporary commit, to be dropped before merge: point CI jobs at the fix-769 image tags, built from this branch with STAGE=1 so that the toolchain in the images includes the specialize.sk fix (needed to compile sql/src without the .collect(Array) workaround). Co-Authored-By: Claude Fable 5 <[email protected]>
56bb92c to
bee8b0d
Compare
Test redo complete — all green ✅As requested, the full test suite was redone after the rebase:
Merge plan
|
## Summary Bumps the `skiplang/compiler/bootstrap` submodule to a bootstrap regenerated from a stage1 compiler that includes the #769 value-class field-access fix (moving the `canInstantiate` check into the `NamedLeaf` branch only). Bootstrap commit: [SkipLabs/skiplang-bootstrap@763ee89](SkipLabs/skiplang-bootstrap@763ee89) (built on top of the current `c352962`). ## Why This is the prerequisite that unblocks the merge of #1077. Once this lands on `main`, the `skiplabs/*:latest` Docker images can be rebuilt (they are built `STAGE=0` from `main`'s bootstrap, so they will then carry the fixed compiler). #1077 can then drop its temporary `ci: use fix-769 Docker images` commit and go green on `:latest`. This PR is intentionally minimal: it changes only the submodule pointer, so `sql/src` here still contains the `.collect(Array)` workaround and CI passes on the current `:latest` images. The `compiler` job builds `STAGE=1` from the new bootstrap and exercises the fixed compiler directly. Related: #1077, #769 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Bumps the bootstrap to include the value-class field-access fix (specialize.sk: canInstantiate check moved into the NamedLeaf branch). Prerequisite for SkipLabs#1077: once this is on main, the :latest images rebuild with a fixed compiler so SkipLabs#1077 can drop its temporary fix-769 image pins. Bootstrap source: SkipLabs/skiplang-bootstrap@763ee89fa2b3 Co-Authored-By: Claude Fable 5 <[email protected]>
Summary
Some<T>.value) if the field type appeared as unresolved type_during compilationflatMapandfilterwithyieldcanInstantiatecheck inside theNamedLeafbranch only (for reference classes which require scalarization), allowing value class field access to proceed without this check.collect(Array)workaround in SqlSchemaMigration.skVerification
Verified end-to-end by building Docker images with
STAGE=1(stage1 compiler compiled from source, which includes this fix) and running the full skdb test suite:Test plan
ALTER TABLE ADD COLUMNwhich exercises schema migration with the lazy iterator code path)generic_refinement_methodtest continues to pass (regression test for the fix)Fixes #769
🤖 Generated with Claude Code