Skip to content

ssa: handle recursive pointer type names#1909

Draft
cpunion wants to merge 2 commits into
xgo-dev:mainfrom
cpunion:codex/goroot-peano-coverage
Draft

ssa: handle recursive pointer type names#1909
cpunion wants to merge 2 commits into
xgo-dev:mainfrom
cpunion:codex/goroot-peano-coverage

Conversation

@cpunion
Copy link
Copy Markdown
Collaborator

@cpunion cpunion commented May 24, 2026

Summary

  • avoid recursively resolving the LLVM element type for Go pointer types, which fixes self-referential named pointer types such as type Number *Number
  • add test/go coverage that runs a recursive named pointer type through llgo, including a 4096-deep Peano construction/count matching fixedbugs/issue4316.go
  • remove the now-covered peano.go and fixedbugs/issue4316.go goroot xfails for darwin/arm64 and linux/amd64

Scope

  • Covered: recursive named pointer / Peano / recursion lowering cases.
  • Not covered here: nil/chan/print/recover/GC/liveness/finalizer/goroutine domains; those remain out of scope for this PR.

Tests

  • go test ./test/goroot -count=1 -run TestGoRootRunCases -timeout 10m -args -goroot "$(go env GOROOT)" -dirs fixedbugs -case '^fixedbugs/issue4316\.go$' -xfail /dev/null -run-timeout 2m
  • go test ./test/goroot -count=1 -run TestGoRootRunCases -timeout 10m -args -goroot "$(go env GOROOT)" -dirs . -case '^peano\.go$' -xfail /dev/null -run-timeout 2m
  • go test ./test/goroot -count=1 -run TestGoRootRunCases -timeout 15m -args -goroot "$(go env GOROOT)" -dirs .,fixedbugs -case '^(peano\.go|fixedbugs/issue4316\.go)$' -xfail /dev/null -run-timeout 2m
  • go test ./test/go -run TestRecursivePointerTypeBuilds -count=1
  • go test ./test/go -count=1
  • go test ./ssa -count=1
  • go test ./cl -list .
  • go test ./cl -run TestRunAndTestFromTestgo -count=1 -timeout 5m

Local test notes

  • go test ./cl -count=1 was also attempted locally and was terminated after 428s without a Peano/named-pointer failure.
  • go test ./cl -run 'TestRunAndTestFromTestgo|TestRunAndTestFromTestrt' -count=1 -timeout 5m timed out in TestRunAndTestFromTestrt/index; this is outside the recursive named pointer / Peano scope.

@cpunion
Copy link
Copy Markdown
Collaborator Author

cpunion commented May 24, 2026

Update after expanding Peano coverage:

  • Classified fixedbugs/issue4316.go as the same recursive named pointer / Peano family as peano.go; it passes on the current PR head with xfail bypassed.
  • Added test/go coverage for 4096-deep type Peano *Peano construction/counting.
  • Removed fixedbugs/issue4316.go xfails for darwin/arm64 and linux/amd64.
  • Left nil/chan/print/recover/GC/liveness/finalizer/goroutine domains untouched.

Local validation passed for focused goroot Peano + issue4316, go test ./test/go -count=1, go test ./ssa -count=1, and go test ./cl -run TestRunAndTestFromTestgo -count=1 -timeout 5m. Full cl/testrt long-run attempts hit local termination/timeout in testrt/index, outside this PR scope.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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