Skip to content

feat(codegen): unboxed-prim-array axis A — perf closed-negative (gap=storage, not tag-guard)#2152

Merged
dancinlife merged 2 commits into
mainfrom
unshadow-unboxed-prim-array
May 29, 2026
Merged

feat(codegen): unboxed-prim-array axis A — perf closed-negative (gap=storage, not tag-guard)#2152
dancinlife merged 2 commits into
mainfrom
unshadow-unboxed-prim-array

Conversation

@dancinlife
Copy link
Copy Markdown
Contributor

typed-repr axis A 파일럿. element-kind 증명(_is_int_literal_array + immutable-let 등록)으로 known-int array의 c-class tag-guard 삭제 → 직접 items[i] read. correctness WIN (4-arm byte-diff IDENTICAL md5 35470124 + 경계-박싱 무결성 통과 9efbbf5d). perf 🔴 CLOSED-NEGATIVE: tag-guard는 clang이 이미 hoist(~0% Δ) — 진짜 벽은 storage(sizeof HexaVal=16 → 16B-strided boxed array는 SIMD-gather 불가 5 vec-ops; native int64_t[] ceiling만 23 vec-ops로 gap 14×→1× 100% 닫힘). codegen-only unbox는 perf 레버 아님 → native HexaArrI64 storage type(runtime change, B9벽) 필요. axis A가 'codegen-only unbox' 결정적 배제, box/unbox 경계규율은 axis B 토대. faithful A/B proxy(B9벽). 🤖 Generated with Claude Code

dancinlife and others added 2 commits May 30, 2026 05:12
…-negative (gap is storage, not tag-guard)

UNSHADOW typed-repr RFC 의 axis A pilot. §c-class 가 "미측정 lever" 로 남긴
"known-array 추적기 → tag-guard 삭제" 를 codegen 에 착지하고 측정했다.

element-kind 증명 (self/codegen.hexa, +124 순수추가):
- `_is_int_literal_array` — 배열 리터럴이 전부 IntLit 인지 (좁은 monomorphic-i64 증명)
- LetStmt 등록 `_known_intarr_set` (불변 let 만), AssignStmt 재대입 시 void
- Index emit: known-int-array + live in-range fact → §c-class array-tag guard 삭제,
  direct `arr.arr_ptr->items[i]`. `_is_known_int(arr[i])` true → sum 이 raw `.i` 추출
- 두 게이트 모두 immutable-let 등록 AND live in-range fact 둘 다 요구 (unproven 무발화)

측정 (mini macOS arm64 best-of-9, tool/unshadow_unboxed_array_bench.hexa):
- g5 byte-diff IDENTICAL 4-arm (md5 35470124) + 동적경계 box 정확 (md5 9efbbf5d 양쪽)
- perf 🔴 CLOSED-NEGATIVE: b_unbox 1.12s ≈ a_boxed 1.12s = ~0% Δ. tag-guard 는
  loop-invariant 라 clang -O2 가 이미 hoist. 진짜 벽 = boxed 저장 (sizeof HexaVal=16,
  items[] 16B-stride, SIMD 불가); native int64_t[](c_native) 만 갭 100% close (0.08≈ref)
- 누락 인프라 = native HexaArrI64/F64 저장 (runtime 변경, B9 벽 밖) = 갭이 사는 곳

correctness WIN (provably-dead guard 삭제·무회귀) + perf 닫힌-부정 (codegen-only unbox
는 레버 아님). element-kind 증명·box/unbox 경계 규율은 axis B(monomorphic struct) 기반.
verdict=.verdicts/unshadow-unboxed-array/

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dancinlife dancinlife merged commit c1e7faa into main May 29, 2026
1 of 8 checks passed
@dancinlife dancinlife deleted the unshadow-unboxed-prim-array branch May 29, 2026 20:14
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.

1 participant