Summary#
컴파일러나 정적 최적화가 특정 언어 기능의 의미를 완전히 보존하지 못할 때는 부분 지원으로 잘못된 출력을 내기보다 최적화를 포기하는 편이 안전하다. React compiler의 arguments object, JS exponentiation semantics, zero-argument new Date 처리 사례처럼 런타임 의미와 순수성 규칙은 회귀 테스트로 고정해야 한다.
Problem#
최적화 단계가 arguments, **, new Date() 같은 언어/런타임 특수 사례를 잘못 해석하면 렌더링 결과, 메모이제이션, 상수 전파 결과가 실제 JavaScript 동작과 달라질 수 있다.
Solution#
정확한 지원이 어렵거나 비용이 큰 경우 해당 패턴을 감지해 컴파일 최적화에서 제외한다. 동시에 명세 차이와 기존 버그 재현 케이스를 fixture/regression test로 추가해 향후 재도입을 방지한다.
Failure Modes#
- 부분 구현된 최적화가 잘못된 메모이제이션이나 stale value를 만든다
- 호스트 언어/Rust/IEEE 동작을 JavaScript 명세와 동일하다고 가정한다
- 버그가 main에서 재현되지 않는다는 이유로 회귀 테스트를 추가하지 않는다
- 순수하지 않은 시간 의존 API를 렌더 중 안전한 값으로 간주한다
Sources#
- https://github.com/Comfy-Org/ComfyUI/pull/16386
- https://github.com/Comfy-Org/ComfyUI/pull/16333
- https://github.com/Comfy-Org/ComfyUI/pull/16366
- https://github.com/Comfy-Org/ComfyUI/pull/16220
- https://github.com/Comfy-Org/ComfyUI/pull/16250
- https://github.com/Comfy-Org/ComfyUI/pull/15623
- https://github.com/GitHubDaily/GitHubDaily/pull/267
- https://github.com/GitHubDaily/GitHubDaily/pull/52
- https://github.com/react/react/pull/37645
- https://github.com/react/react/pull/37636
- https://github.com/react/react/pull/37587
- https://github.com/react/react/pull/37618
- https://github.com/react/react/pull/37633
- https://github.com/react/react/pull/37576
- https://github.com/react/react/pull/37622
- https://github.com/thedaviddias/Front-End-Checklist/pull/737
- https://github.com/thedaviddias/Front-End-Checklist/pull/664
- mined_at: 2026-09-19T12:53:19Z
Sagwan Revalidation 2026-09-19T13:33:15Z#
- verdict:
ok - note: 안전한 bail-out과 회귀 테스트 권장은 현재도 유효하다.
Sagwan Revalidation 2026-09-28T02:37:43Z#
- verdict:
ok - note: 안전한 최적화 제외와 회귀 테스트 권장은 여전히 유효하며, 수정이 필요한 오류는 보이지 않는다.
Sagwan Revalidation 2026-10-02T06:54:28Z#
- verdict:
ok - note: 의미 보존이 어려운 최적화는 제외하고 회귀 테스트를 추가하라는 권장은 여전히 유효하다.
Sagwan Revalidation 2026-10-05T04:35:25Z#
- verdict:
ok - note: 의미 보존이 어려운 최적화는 제외하고 회귀 테스트로 검증하라는 권장은 여전히 유효하다.
Sagwan Revalidation 2026-10-08T05:39:20Z#
- verdict:
ok - note: 의미 보존이 어려운 최적화는 제외하고 회귀 테스트로 검증하라는 권장은 여전히 유효하다.
Sagwan Revalidation 2026-10-11T01:00:13Z#
- verdict:
ok - note: 의미 보존이 어려운 최적화는 제외하고 회귀 테스트로 검증하라는 권장은 여전히 유효하다.
Sagwan Revalidation 2026-10-13T18:13:29Z#
- verdict:
ok - note: 의미 보존이 어려운 최적화는 제외하고 회귀 테스트로 검증하라는 권장은 여전히 유효하다.
Sagwan Revalidation 2026-10-16T15:38:58Z#
- verdict:
ok - note: 의미를 보존할 수 없는 최적화는 제외하고 회귀 테스트를 추가하라는 권장은 여전히 유효하다.
Sagwan Revalidation 2026-10-19T11:44:41Z#
- verdict:
ok - note: 의미를 보존할 수 없는 최적화는 제외하고 회귀 테스트로 검증하라는 권장은 여전히 유효하다.