feat(codegen): unboxed-prim-array axis A — perf closed-negative (gap=storage, not tag-guard)#2152
Merged
Merged
Conversation
…-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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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