feat(unshadow): round1 land — HexaVal 언박싱(11.3×)·same-TU(opt-in)·적층원칙 문서#2135
Merged
Conversation
… not out-of-line hexa_int()
UNSHADOW 🟢 HexaVal 언박싱 pilot. STRUCTURAL-2 known-int BinOp fast-path
(codegen.hexa L5127)는 두 피연산자가 정적 TAG_INT 임을 이미 증명하므로
결과도 정적 TAG_INT 다. origin/main 은 결과를 out-of-line `hexa_int(…)` 로
재박싱했는데, runtime.h 가 hexa_int 를 함수 선언으로만 export 하여 -O2 에서
`bl _hexa_int` opaque ABI 호출이 남고 clang 이 runtime.o 벽 너머로 fold/LICM
못 한다 (§parity-attest 의 raw 7.9×~1263× 갭 주범). pilot 은 결과를 inline C
compound literal `((HexaVal){.tag=TAG_INT,.i=(…)})` 로 emit — runtime_core_emit
의 hexa_int 본문과 글자 그대로 동일한 값(byte-eq), 단 박싱 ABI 호출만 제거.
`_is_known_int` 증명 시만 발화, else 기존 boxed emit = 일반 경로 무변경.
측정 (mini macOS arm64 · clang 21 · faithful C A/B proxy, same runtime.o):
known-int 핫루프 599→53ms (11.30×, 91% drop), parity gap 11.09×→0.98×
(AT PARITY, 100% closed), hot-fn `bl _hexa_int` 17→0, AFTER mix() = 순수
레지스터 arith. g5 byte-diff IDENTICAL (md5 63888b02).
정직 caveat: full self-host rebuild 은 B9 빌드 벽(generated-.c 부재 + runtime.h
ABI skew)으로 차단 → faithful C proxy 측정(byte-eq 는 runtime 소스서 증명).
mut-누산기(fib류 known-int 미발화)는 미적용 = follow-up.
verdict=.verdicts/unshadow-hexaval-unbox/ · bench=domains/UNSHADOW.bench.md §hexaval-unbox
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…fit pilot
UNSHADOW milestone "🔵×🟡 same-TU 빌드 기본화" 측정 파일럿. §lto-unwall(−31%)을
C-emit 빌드 레시피로 만들고 default/opt-in/no 정직 권고를 측정으로 도출.
self/main.hexa cmd_build 에 GATED same-TU MODE (opt-in·reversible):
· codegen 반쪽 — HEXA_SAME_TU=1 → transpile 에 HEXA_USE_RUNTIME_C=1(기존
codegen.hexa:947 hatch) → user.c `#include "runtime.c"` (런타임을 user TU 로).
· link 반쪽 — HEXA_SAME_TU=1 → 별 runtime 2nd TU(_rt_input) 제거 → 단일 TU.
· shared/target 가드. unset → byte-identical legacy walled.
측정(mini macOS arm64 · best-of-5 · A/B 프록시, full rebuild=B9 벽 차단·스펙 허용):
BENEFIT — 경계호출 인라인 전면 개방(_rt_str_starts_with 2→0·_hexa_contains_poly
1→0·_hexa_int 12→0): string −21%·HexaVal-arith −24%(string 전용 아님).
COST — 빌드시간 ~35×(WARM 0.10s vs same-TU 3.55s · runtime.o 캐시 구조적 불가)·
바이너리 −0.05%(wash)·generated-runtime.c 의존 재도입.
g5 byte-IDENTICAL(0e2afa85·657d1ec4).
권고 = OPT-IN flag, NOT default (terminal). release/perf 빌드용 가치.
verdict=.verdicts/unshadow-same-tu/ · bench=UNSHADOW.bench.md §same-tu ·
재현=tool/unshadow_same_tu_bench.hexa. NO hand-written .c (B9: runtime source
는 emitter SSOT). milestone [x] flip.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…asured-evidence table 원칙(🟡 floor 상속 + 🔵 ceiling 적층 + ⛔ runtime.o ABI 벽 + 🔑 LTO/same-TU)은 #2095 에서 이미 easy.md §HEXA-STACK 으로 명문화됨. 빠진 조각 = 이번 캠페인 누적 실측을 한 표로 묶는 consolidated 측정 증거. easy.md §HEXA-STACK 에 "측정 증거" 표 추가 — 각 🔵 ceiling 기법(=#2 28%·A 65%·B 47%) + 🟢 arena RSS −40% + 🔑 same-TU FLIP −31% + 정직한 한계(C tag-elision 🔴·bounds-null 🔴 NULL·HexaVal 언박싱=미측정 예측레버). UNSHADOW.md milestone → [x]. doc-only, 측정 0(전부 기존 verdict 인용). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts: # domains/UNSHADOW.bench.md # domains/UNSHADOW.md
# Conflicts: # domains/UNSHADOW.log.md # domains/UNSHADOW.md
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.
직전 /all-fg-go 3 브랜치 통합 랜딩 (UNSHADOW 3 milestone close): ① 🟢 HexaVal 언박싱 known-int rebox→inline literal, parity gap 11.09×→0.98% (~100% closed), byte-identical · ② 🔵×🟡 same-TU 빌드 MODE(HEXA_SAME_TU=1 opt-in) string −21%/arith −24%, 35× build tax → opt-in 권고 · ③ 🏗️ 적층원칙 문서 + 측정 증거표. codegen.hexa(unbox)+main.hexa(same-TU)+md. .c 손작성 0. 🤖 Generated with Claude Code