fix(hht): preserve metric association and complete MKL actions

This commit is contained in:
KOKO\Mimi
2026-10-14 18:38:00 +09:00
parent 2853051896
commit c58d499727
6 changed files with 155 additions and 43 deletions
@@ -160,3 +160,23 @@ Standalone include의 vendor C4819 경고는 보존했다. 실제 production과
[기계어/실행 파일 보존 기록](../../.harness/performance/t4/micro-warning-policy-text-comparison.json)을 따른다.
전체 Debug·원본 비교·C08 current grid·VTune 최종 수집·공식 단일 시간 측정은
이 단계에서 실행하지 않았다. 변경되지 않은 reference와 tolerance를 사용해야 한다.
## f9 고정 source 후속 SW 프로파일 및 metric/coverage 수정
f9e0df66dc9ab04e6a3e295e7ade1df6add15193 source의 Release CLI target 빌드 native0,2.210초. 기존 동일 source의 fresh MSVC Release LIB 디렉터리에 정식 fesa_cli target만 --parallel4 빌드했으며 다른 source object를 복사하지 않았다. parent `.harness/performance/t4/cli-build-native.json`, `cli-runtime-hashes.json` 및 `f9-shell-sw-150s/frozen-profile-source.json`에 실제 argv/settings/source/CLI/DLL/PDB hash를 고정했다.
동일 원본 input SHA B8922243CA8DDFE20B1DD39F3123207F789A1A75F6B10DBB6B0BC0B5A40DFFF5를 scratch에 복사해 SW hotspots150초를 1회 수집했다. Collector native4는 제한 수집의 partial 종료이며 target native exit는 미확인이다. Collector 총171.409초, watchdog240초 미발동, ownedtarget18316 종료 및 remaining_targets=[] 확인. 원본/scratch 입력 hash 유지. summary/functions/callstacks export는 각각 native0이다. 수집 자료는 parent `.harness/performance/t4/f9-shell-sw-150s/`에 보존한다.
VTune summary elapsed149.866초/CPU466.466초. Self CPU: shell Jet*85.260초, iomp64.371초, MKL dgemm40.878초, PARDISO kernel31.029초, malloc24.373초, shell Jet+23.937초, inertia Jet*23.821초, errchk_dgemm12.305초, MultiplyTransposeRight8.105초. Callstack inclusive attribution은 EvaluateAssembly240.854초, EvaluateConstraintOperators78.270초, EvaluateInternalResidualAndTangent254.027초, MultiplyTransposeRight86.911초, CheckGraphRegularity2.386초다. Inclusive 값은 서로 겹치며 합산하거나 벽시계로 사용하지 않는다. 작은 MKL dispatch 비용과 내부 constraint 재평가 비용은 후속 후보의 근거다. Sample에는 constant operand/proven-zero derivative 여부가 없으므로 영도함수 생략의 실제 비중은 미확인이다.
150초 구간 마지막 accepted increment1/time0.1/iteration3이다. 기존150초 baseline은 increment2/time0.2였으므로 현재 후보를 전체 성능 개선이나100초 합격으로 기록하지 않는다. f9 source의 증거는 이후 수정에 소급하지 않는다. Callstack parser 최초 PowerShell 시도는 blank separator row에서 numeric parse 오류로 중단했고, 명시적 blank delimiter를 처리하는 `attribute-callpaths.py` native0 결과를 사용한다.
프로파일을 고정한 뒤 root85ae2eb를 병합한 source2853051896091ca0e612c95a65a442f48a8e5558에서 후속 수정했다. 공통 high+low finite classifier와 생성 build ignore를 동기화했으며 공통 public API/flags 변경은 없다. 해당 공통 수정의 독립 검증은 root evidence 소유다.
추가 독립 검토는 metric GEMV의 overflow 반례를 발견했다. M=DBL_MAX, epsilon=2^-26, t=sqrt(1-epsilon^2), n=(epsilon,0.6t,0.8t), B=[[0,M,M],[M,0,0],[M,0,0]]에서 기존 ordered (n_i*B_ij)*n_j 합은 finite positive지만 B*n의 첫 성분은 overflow한다. `HhtReducedOperators.NullMetricKeepsFiniteLeftAssociatedProducts`를 먼저 추가해 실제 RED(native8/1failed), 이후 GREEN(native0/1PASS)를 확인했다. PSD 가정을 새로 추가하거나 accepted metric 범위를 좁히지 않는다.
두 metric caller(CheckGraphRegularity/CheckRegularity)는 analysis-private `OrderedNullMetric`으로9entry MKL diagonal product를 두 번 계산하고 기존 i/j 순서로 누적한다. 첫 product가 nonfinite이면 원래 두 번째 product도 nonfinite이며 최종 양의 finite gate를 통과할 수 없으므로 caller의 기존 진단 위치로 NaN을 반환한다. Source nonfinite도 같은 caller gate로 반환한다. 실제 원래 assertion/failure category/condition2^-32/scale/diagnostic order를 유지한다. 불필요해진 SparseEntry만 제거했다.
EvaluateAssembly의 hidden_second는 인접 shell 조립 Hessian map의 일반 bilinear action이다. node map 크기를24로 제한하지 않고 map 순서대로 H_ij*v_i 및 결과*v_j를 MKL diagonal batch 두 번 계산한 뒤 기존 hidden_second/abs-scale 순서로 누적한다. mass residual scale의24x24 m(row,col)*a[col]도 MKL diagonal entry batch로 계산한 뒤 기존 row/column abs 누적 순서를 유지한다. 이 두 일반 product를 fixed3 또는 AD 예외로 묶지 않는다. Private EntryProducts는 finite pair만 backend에 전달하고 invalid/intermediate entries는 NaN으로 유지하여 원래 mass/hidden finite gate에서 실패하게 한다. Failed/partial candidate를 유효 state로 공개하지 않는다.
수정 첫 build는 mass_action pack을 잘못된 첫 Gather(a) 위치에 삽입해 native2로 실패했다. 실패 source patch와 native/log는 parent `metric-green-build-failed.patch`, `metric-green-native.json`에 보존했다. Correct ordered assembly 위치로 옮긴 frozen source `metric-coverage-source.json`에서 정식 Debug build native0/6edges, 반례 GREEN native0, 관련 short106/106 PASS(native0/36.02초)를 확인했다. Actual Ninja deps에 hht_dynamic_internal.h와 dense_blas_internal.h가 포함된다. Test106은 mixed-time fixture를 제외하며 최종 전체 Debug/CTest/reference/C08/전체 모델 검증은 여전히 T5 미실행이다. 이 수정은 후속 DGER/constant/reuse source와 분리하며 독립 source 검토를 추가로 받는다.