Skip to content

fix(interop): preserve typed-array backing slices - #821

Open
nnunley wants to merge 1 commit into
nooga:mainfrom
nnunley:fix/typed-array-backing
Open

fix(interop): preserve typed-array backing slices#821
nnunley wants to merge 1 commit into
nooga:mainfrom
nnunley:fix/typed-array-backing

Conversation

@nnunley

@nnunley nnunley commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • preserve compatible TypedArray backing slices at the Go reflection boundary
  • keep generic vector/list and incompatible-element conversion behavior unchanged
  • cover backing identity and host mutation for byte, int, float, object, and named slice types
  • reproduce io.Reader.Read at the language level and verify caller-visible bytes

Verification

  • focused VM/API/language regression tests
  • focused race tests
  • go vet ./pkg/vm ./pkg/api ./test
  • full go test ./pkg/vm ./pkg/api
  • all Go-level ./test tests outside the fixture runner
  • make generate
  • make check-generated
  • independent review: PASS

The full local fixture runner was also attempted: 810 tests passed and 10 fixture cases failed only because this sandbox denies writes to literal /tmp paths. The exact #813 regression passes.

Fixes #813

@nnunley
nnunley requested review from mparrett and nooga September 7, 2026 19:26

@mparrett mparrett left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actionable findings. The compatible-slice fast path preserves TypedArray backing identity while retaining the existing conversion path for fixed arrays, incompatible element types, and persistent collections. Focused VM/API/language tests, race tests, vet, and generated-artifact validation pass; CI is green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Go interop copies mutable byte-array arguments, discarding io.Reader.Read output

2 participants