Skip to content

Prepare abstract interpreter branch for runtime integration#33

Closed
wolfy-j wants to merge 8 commits into
refactor/interproc-facts-domainfrom
codex/abstract-merge-gates
Closed

Prepare abstract interpreter branch for runtime integration#33
wolfy-j wants to merge 8 commits into
refactor/interproc-facts-domainfrom
codex/abstract-merge-gates

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • port the current protected-call, stack inspection, CI, and Windows fixture fixes
  • version the canonical manifest wire and return typed rebuild signals for legacy binary caches
  • make parser generation reproducible and enforce it in CI
  • propagate semantic document locations through judgment renderers and clear all current lint findings

This intentionally does not include abstract-interpreter performance work, does not release, and should not be merged until the runtime companion PR is ready.

Verification

  • go test ./... -count=1
  • go test -race ./analysis/... -count=1
  • golangci-lint run ./... (0 issues)
  • go generate ./compiler/parse leaves parser.go clean
  • promptmap meta audit: 160/160 clean classifications, 0 errors

skhaz and others added 8 commits July 10, 2026 11:58
Why:
GetStackFrame never reported upvalues: it read funcTable["f"] for the frame
function, but GetInfo's 'f' flag RETURNS the *LFunction (it does not store it
under any table key). The funcTable was always empty, so the upvalue loop was
skipped and debug.getupvalue kept disagreeing with inspect.

What:
- Capture the *LFunction from GetInfo's return value and use it for both the
  Go-function name resolution and the upvalue walk.
- Drop the unused funcTable allocation.
- Add TestGetStackFrameCapturesUpvalues guarding against regression.
Why:
xpcall leaked its error and never invoked the message handler when invoked
outside a coroutine (e.g. under DoString/PCall), aborting the surrounding
chunk. basePCall was updated to wrap CallK in its own defer/recover, but
baseXPCall was left depending on threadRun's recover via handleProtectedError
— a layer that only exists inside coroutines.

What:
- Wrap baseXPCall's CallK in an inline defer/recover, mirroring basePCall.
- Invoke the error handler BEFORE resetting the stack so it can inspect the
  throw site (debug.getlocal / debug.traceback), matching standard Lua
  semantics (PCall's own errfunc path does the same).
- Add errorObjectFromRecover and invokeErrorHandler helpers.
- Add xpcall_direct_test.go covering direct-call catch, chunk preservation,
  success path, nesting under pcall, and the still-working coroutine path.
@wolfy-j

wolfy-j commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Closing as duplicate of the coordinated abstract-interpreter and runtime migration lanes already in progress.

@wolfy-j wolfy-j closed this Jul 10, 2026
@wolfy-j wolfy-j deleted the codex/abstract-merge-gates branch July 10, 2026 16:49
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.

2 participants