6.6 KiB
Nonlinear MITC4 Jet 기준 검사
fesa_jet_baseline_tests는 제품의 private 구현을 별도 번역 단위에 포함하고
일반 solver archive를 연결한다. 제품 source와 공개 API를 계측하지 않는다.
독립 다항식 지수 미분 및 미분 항등식과 원래 경로의 비트 snapshot은 별도 근거다.
VS x64 환경과 저장소의 승인된 dependency 환경변수에서 실행한다.
MSBuild msvc\fesa_jet_baseline_tests.vcxproj /m:2 /p:Configuration=Debug /p:Platform=x64
.build\native\Debug\tests\fesa_jet_baseline_tests.exe --verify
cmake --preset windows-msvc-ninja-debug
cmake --build --preset windows-msvc-ninja-debug --target fesa_jet_baseline_tests --parallel 2
ctest --preset windows-msvc-ninja-debug -R "^NonlinearMitc4Jet\.IndependentOracle$" --output-on-failure
Release는 Native의 Configuration=Release 또는 해당 CMake Release preset을 쓴다.
기존 unit/integration/reference 세 GTest 실행물의 발견 identity와 이 전용 검사의
선택 수는 구분한다. CTest의 --verify는 baseline 파일을 생성하지 않는다.
승인된 기준 revision에서만 새 경로에 --write <snapshot>을 한 번 실행한다.
기존 파일은 덮어쓰지 않는다. 이후에는 원래 파일과 hash를 보존하고 같은 빌드 경로와
구성끼리 비교한다. 일반 회귀나 후보 코드에서 --write로 기대값을 만들지 않는다.
.build\native\Debug\tests\fesa_jet_baseline_tests.exe --compare "<immutable-Debug-snapshot>"
.build\native\Release\tests\fesa_jet_baseline_tests.exe --compare "<immutable-Release-snapshot>"
.build\cmake-debug\tests\fesa_jet_baseline_tests.exe --compare "<immutable-CMake-Debug-snapshot>"
--compare <snapshot> --mutate와 --corrupt-oracle는 각각 snapshot 비교와 독립
oracle의 fixture 전용 오류 주입이며 exit 1이 기대값이다. --bench는 별도 micro
측정이다. 연산의 할당·해제와 교대 입력값 갱신을 포함하고 fixture 생성은 제외한다.
전체 채널을 읽는 noinline checksum과 volatile consume을 포함해 결과 제거를 막는다.
공식 모델 CLI의 시간과 혼합하지 않는다.
snapshot은 finite 값·signed zero·Inf 비트, NaN 분류, provenance와 implicit Hessian, 복원한 초기 FP 환경 및 연산 뒤 FE/rounding/control word/full MXCSR를 기록한다. 공개 반환의 방향 요청 유무·실패 진단·회복량 identity도 포함한다. 수식의 정확성은 독립 oracle로 검사하고, snapshot은 기준의 계산 순서와 관측 의미 보존을 검사한다.
T2 곱셈 경계는 기존 T1 snapshot과 별도 CLI로 보존한다. 원본 제품 source의 hash를
확인하고 보존한 원본 archive를 연결한 실행물에서만 새 경로에 한 번 생성한다.
후보는 --product-compare만 실행한다. 기존 파일을 덮어쓰거나 T1 기대값을 확장하지 않는다.
<original-fixture.exe> --product-write <new-immutable-product-snapshot>
<candidate-fixture.exe> --product-compare <immutable-product-snapshot>
<candidate-fixture.exe> --product-compare <immutable-product-snapshot> --mutate
<candidate-fixture.exe> --product-compare <immutable-product-snapshot> --omit-transpose
마지막 두 명령은 각각 출력 변조와 reverse 외적 항 누락의 fixture 전용 음성 대조로 exit 1이 기대값이다. 이 그룹은 96개 입력을 4 rounding × 4 FTZ/DAZ × 2 초기 sticky 환경에서 실행한 3072개 곱셈이다. 전체 651 채널, 비대칭·공유·implicit Hessian과 입력 불변성, provenance, 전체 FP 상태를 비교한다. finite 전용 ±0·subnormal·underflow· overflow gradient와 비유한 입력 거부를 구분하며, 실제 MKL 두 외적의 operand 교환과 transpose 성분도 비교한다. 두 호출의 FP 상태는 각각 기록하므로 입력 검사 조기 종료로 차이가 있는 경우를 수치 동등성으로 숨기지 않는다. NaN payload는 비교하지 않는다. 이 그룹은 예외를 mask한 상태의 관측이다. Unmasked 환경의 최초 trap 순서는 별도 SEH/process 관측이나 생성 코드 근거가 필요하며, source의 row-major 순서만으로 보장하지 않는다.
T2의 무가드 단일 외적 후보는 unmasked 최초 INVALID/OVERFLOW 순서가 달라 비채택했다. 채택한 guarded 경로는 MXCSR의 여섯 예외가 모두 masked이고 첫 외적이 성공한 경우에만 전치 성분과 276개 상삼각 scratch를 재사용한다. Unmasked 환경과 외적 거부는 기존 두 호출, 576개 reverse 배열과 row-major 결합을 유지한다. Masked snapshot과 별도 원본/후보 SEH 관측을 함께 확인하며, 정상 경로의 임시 쓰기 감소를 전체 stack 예약 감소로 보고하지 않는다.
T3 누적 검사는 기존 T1/T2 snapshot을 확장하지 않고 별도 파일을 쓴다. 원본 source와 보존 archive의 출처를 확인한 실행물에서만 새 경로에 생성한다. 실제 CMake 경로는 원본 source staging을 CMake로 configure/build한 실행물과 구분해 연결한다.
<original-fixture.exe> --accumulation-write <new-immutable-accumulation-snapshot>
<candidate-fixture.exe> --accumulation-compare <immutable-accumulation-snapshot>
<candidate-fixture.exe> --accumulation-compare <immutable-accumulation-snapshot> --reassociate
<original-fixture.exe> --accumulation-write <new-immutable-alias-snapshot> --unique-alias
<candidate-fixture.exe> --accumulation-compare <immutable-alias-snapshot> --unique-alias
<candidate-fixture.exe> --accumulation-compare <immutable-alias-snapshot> --unique-alias --overwrite-input
<candidate-fixture.exe> --accumulation-bench
일반 그룹은 12개 경계 × 4 rounding × 2 FTZ/DAZ × 2 초기 sticky의 192개 조합으로
Dot·Cross·3×3 matrix/vector·일반/고정 frame·energy 형태 누적·상수 Jet/scalar를
검사한다. 별도 8개 alias 그룹은 유일한 materialized Hessian을 가진 동일 객체,
surviving copy와 공유 rvalue를 검사한다. --reassociate와 --overwrite-input는
fixture 전용 음성 대조이며 exit 1이 기대값이다. 모든 비교는 651개 채널·provenance·
implicit Hessian·FP 상태를 포함한다. 상수 Jet와 scalar를 서로 같은 연산으로 가정하지 않는다.
--accumulation-bench는 여섯 연산 종류마다 3,000회, 전체 결과 채널 checksum을
소비한다. Fixture 준비는 제외하고 연산의 할당·해제와 checksum은 포함한다. 이 일반
실행물의 시간과 별도 복사 source의 Hessian materialization 계측을 구분한다.
Unmasked 최초 trap은 별도 SEH/process 관측으로, 곱셈 단계와 실제 덧셈 단계의
검증을 구분한다. 전체 모델 시간·stack 예약 감소를 뜻하지 않는다.