Files
FESADev/docs/mitc4-shell-feast-eigen2/implementation-numerical-review.md
T

101 lines
12 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 구현 독립 수치 검토
- Feature: `mitc4-shell-feast-eigen2`; Owner: `numerical-review-agent`; 검토일: `2026-09-09`.
- 판정: **correction-required / verification-incomplete**.
- 대상: 질량·stabilization·reduction, 수정된 FEAST backend와 `linear_frequency_procedure.cpp`. Writer는 검토하지 않았다.
- 기준: [formulation](formulation.md), [mass/stabilization](formulation-mass-stabilization.md), [eigen](formulation-eigen.md), [controls](numerical-review-controls.md), [cases](numerical-review-cases.md), [requirements](requirements.md), [공통 tolerance](../TOLERANCE.md).
- 최초 finding·scalar 반례는 [이전 검토 상세](implementation-numerical-review-history.md)에 보존한다. 아래는 후속 수정본에 대한 현재 판정이다.
## 이전 finding의 수정 확인
Central Count·안정적 QR까지 수정한 최신 저장본 `mkl_feast_eigen_solver.cpp`를 직접 대조했다.
아래 source 판정과 메인이 전달한 실제 재실행 결과를 구분한다.
| Finding | 현재 상태 | 최신 정적 evidence |
| --- | --- | --- |
| NR-IMP-01 | **addressed** | [mass source](../../src/fesa/elements/mitc4_shell.cpp)의 `j-h*(h/m)` strict finite/positive와 [density 회귀](../../tests/unit/elements/mitc4_shell_test.cpp) 확인. 메인이 실제 통과를 전달 |
| NR-IMP-02 | **open** | Mass Ck oracle/`ExpectGlobalZCovariance`의 승인된 차원별 scale·D congruence 적용 및 단위변환 coverage 미완료 |
| NR-IMP-03 | **addressed in source** | [backend](../../src/fesa/solvers/eigen/mkl_feast_eigen_solver.cpp) optional info1/2/3/-5만 fallback, 나머지는 실패 |
| NR-IMP-04 | **addressed in source** | Offsets `0,±1,±2,±4`, 21-call 예약으로 optimization384 유지, 각 Count/solve의 total512 guard 확인. Central Count 473–484행에서 동일 lower의 모든 성공 이력에 대해 upper/count 단조성과 동일 endpoint count 일치를 검사 |
| NR-IMP-05 | **addressed in source** | 최초·retry interior 3-count guard, previous/new capacity 비교와 실제 interval 변경 조건을 확인. Retry Count도 위 central history 검사를 거침 |
| NR-IMP-06 | **addressed in source** | 초기 재시도는 16delta padding만 2^j배 |
| NR-IMP-07 | **addressed in source** | 229–245행의 relative pivot·`alpha=-copysign(norm,x0)` reflector, 276–290행의 Q column sign으로 positive R diagonal 및 `norm(Q^T Q-I)_F/sqrt(m0)<=1e-12` 확인 |
| NR-IMP-08 | **production guards added; failure coverage incomplete** | n²/nm0 storage·PTRDIFF/container·padding·count[0,n] 검사, 주요 allocation 변환 및 [procedure](../../src/fesa/analysis/linear_frequency_procedure.cpp)의 bad_alloc/length_error 변환 확인. 경계/실패 주입 검증 미확인 |
| NR-IMP-09 | **addressed in source** | Successful epsout/loop 및 유효한 반환 범위의 모든 eigenvalue/vector finite 검사를 endpoint/retry 앞에 수행. Finite-first sort, physical lambda 환산, exact-zero nonfinite backend res의 unavailable 처리, all-c pairwise/Frobenius Gram acceptance 확인 |
## 최신 backend correction과 검증 경계
[Backend source](../../src/fesa/solvers/eigen/mkl_feast_eigen_solver.cpp)의 이전 count/QR/nonfinite-vector finding은
현재 저장본에서 수정됐다. Optional guard가 중간 실패해도 이전 성공 Count는 공통 이력에 남아 이후 대조에 사용된다.
Signed Householder는 cancellation을 피하며 Q column sign 변경은 R row sign 변경과 대응하므로 positive diagonal 규칙에 맞는다.
`ValidateSymmetry` 134–166행도 scale로 정규화한 Frobenius 비율이며, max-entry acceptance라는 이전 finding은 해소됐다.
C5 실패/status/동일 endpoint/역전/retry/budget/allocation 주입은 **실행 evidence 미완료**다.
`CallHistory`는 residual 실패에 연결됐지만 다른 early failure의 전체 이력 보존도 미확인이다.
Source correction 확인을 해당 실패 경로의 실행 통과로 확대하지 않는다. NR-IMP-02의 mass oracle 차원별 scale은 별도로 남는다.
## Frequency procedure와 reduction의 대조 결과
[Procedure source](../../src/fesa/analysis/linear_frequency_procedure.cpp)에서 다음 수학 계약과의 불일치는 발견하지 못했다.
- 161–185행: active shell 길이 scale과 analytic reduction 뒤 actual FEAST를 사용하고, exact-zero A의 scale 후보는 `min(E/rho/ell²)`로 만든다.
- 201–223행: K/M Frobenius norm은 실제 free/free 부분에 D congruence를 적용해 같은 단위로 계산한다.
- 235–270행: `q=D y`, scaled source maximum-component sign, actual ML mass 정규화, 최종 phi에서 g/y 재계산, 원 조립 K/ML의 모든 free DOF residual·Rayleigh·energy를 평가한다. Constrained components는 exact0이며 modal reaction을 생성하지 않는다.
- 271–305행: whitened/operator residual 및 raw lambda를 보존한 near-zero/positive·connected cluster·frequency validity를 검사한다. 전체 c를 검증하고 첫 N개만 mode/vector로 공개한다.
- 306–319행: 정규화된 physical phi와 actual mass action으로 전체 c의 Gram/각 pairwise orthogonality를 다시 계산한다. `nz=0`의 null metric은 applicable flag0와 연결된다.
- [Reduction tests](../../tests/unit/analysis/eigen_reduction_test.cpp)에 비대각 Mp의 lambda2,10/3·original mass 복원, p1/2000 positive, 2 free rotations, MZ 위반, drill-only/all-fixed empty 실패가 추가됐다.
## 원본 eigen column20 residual 실패의 한정 재검토
메인이 전달한 correction 후 실제 값은 `n=3125,c=22,m0=33`, backend 26 calls,
`rho_B=1.48674481038207483e-10`이다. **현재 근거로 procedure/reduction의 구현 결함이 원인이라고 판정할 수 없으며,
보고된 값에 대한 실패 처리는 승인 C3-02/C5와 일치한다.** 기준1e-10을 48.6745% 초과하고,
requested10 밖의 column20도 검증 대상인 전체 c개에 속하므로 삭제하거나 검사에서 제외할 수 없다.
FEAST 성공 status·trace stopping은 이 독립 operator residual 기준을 대신하지 않는다.
- [Procedure](../../src/fesa/analysis/linear_frequency_procedure.cpp) 184–186행은 backend 실패를 즉시 반환한다.
따라서 201행 이후의 scaled original-free norm, `q=D y`, 최종 physical normalization·Gram/energy는
이번 실패 때 실행되지 않았다. 그 계산에서 이번 backend column20 오류가 생겼다는 설명은 실행 순서와 맞지 않는다.
- 최신 [reduction](../../src/fesa/analysis/eigen_reduction.cpp) 116–206, 301–356행을 다시 대조했다.
`Mp/scale=L0 L0^T`, lift=`P L0^-T/sqrt(scale)`, `A=lift^T Khat_f lift`의 전치·양쪽 D·질량·단위는 일치한다.
실제 global BC의 exact null 처리와 원 MZ/KZ/PZ 검증에도 이 residual 실패를 설명하는 수식 오류를 발견하지 못했다.
이는 실제 큰 모델의 forward accuracy 보장이거나 모든 입력 inventory의 독립 검증 완료를 뜻하지 않는다.
- Backend가 계산하는 `norm((A/s)x-mu*x)/norm(x)`는 해당 승인 metric이다.
모드 진폭을 바꿔도 비율은 같고 물리 mass 정규화로 이 값을 낮추려는 변경은 근거가 없다.
메인이 전달한 column20의 correction 전·후 actual rerun 진단값은 다음과 같다.
| 관찰 | 이전 실행 | 최신 correction 후 실행 |
| --- | ---: | ---: |
| FEAST info / loop | 0 / 4 | 0 / 4 |
| trace epsout | 2.82730672643927457e-14 | 2.82488401287762986e-14 |
| full CSR rho_B | 1.42356735413003805e-10 | 1.48674481038207483e-10 |
| mirrored upper CSR rho_B | 1.42356735389686902e-10 | 1.48674481542089335e-10 |
| full/upper difference action norm | 1.24572423402534915e-17 | 1.38724134018909290e-17 |
**해당 실행 판정: mandatory all-c residual failure confirmed.** FEAST가 실제 받은 symmetric upper operator에서도
같은 기준을 넘으므로 full/upper symmetry roundoff는 이 실패의 원인이 아니다.
고정 `fpm[5]=1` trace stopping이 4회에서 충족된 결과이며 **최대20회 반복을 소진한 실패가 아니다**.
따라서 단순히 maximum loop를 늘리는 것을 확인된 원인 수정으로 제시할 수 없다.
작은 trace 변화나 `info=0`을 모든 eigenpair residual의 통과로 해석하지 않는다.
최신 진단은 위 central Count·안정적 QR correction **이후 실행**이다. 확인된 구현 결함을 수정한 뒤에도
승인 fixed controls로 얻은 이 모델의 결과가 mandatory all-c 기준을 충족하지 못한다.
이는 모든 잠재적 구현 결함을 배제한 증명은 아니지만, 현재 reference 성공 또는 기능 완료 판정을 막는 실제 evidence다.
전체 runner 통과가 있더라도 이 필수 residual/reference 실패를 대신 해소하지 않는다.
FEAST stopping/control·후검증 기준·실패 retry 정책을 바꾸려는 경우에는 고정 C3/C5 계약의
**사용자 결정과 관련 수치 재검토가 먼저 필요하다**. 구현 correction은 기존 계약 안에서 진행할 수 있으며,
mass·seed·N 변경, column20 제외 또는 실패 후 미승인 재시도의 근거가 되지 않는다.
이번 검토자는 actual rerun을 직접 실행하지 않았고 전달받은 진단값과 read-only 실행 경로를 대조했다.
## 남은 검증과 실행 경계
- **NR-IMP-10 / upstream-contract-conflict:** S3의 public static global moment failure는 exact numerical drilling torque에서 발생한다. `norm(e_M)=95/41476`, 현재 normalized metric≈7.328771e-4다. [독립 유도와 판단](implementation-numerical-review-s3-static.md)을 참조한다. 메인은 수정된 E2-C09 direct pencil/full Kq-F covariance 테스트 통과와 별도 public rejection 재현을 전달했다. 수학 case의 검증은 연결됐지만 public 지원 범위의 평형 충돌은 미해결이다.
- [Procedure integration tests](../../tests/integration/analysis/linear_frequency_procedure_test.cpp)는 S3 direct pencil/full residual covariance와 free panel의 여섯 near-zero mode/all-c evidence를 다룬다. Density4 및 length1024의 물리 단위변환에서 lambda·rotation amplitude·residual/energy를 검증하는 테스트도 추가됐고 메인은 최신 focused 통과를 전달했다. Wrong-mass/vector/constraint mutation 검증은 미완료다.
- Mass의 모든 warped Ck/rows·first spatial moment·두 mass의 독립 energy/Jensen·mesh 오차·rank20/rank5·physical rigid Gram, 독립 tangent inventory 및 frozen nonlinear/retained static 검증은 최초 상세의 coverage gap이 남아 있다.
- [Actual FEAST tests](../../tests/unit/solvers/eigen/mkl_feast_eigen_solver_test.cpp)에 zero/positive known spectra의 lowest prefix와 Givens congruence로 회전한 close distinct spectrum/Gram 검증이 추가됐고 메인은 최신 focused 통과를 전달했다. C5 status·guard collision/역전·retry·budget·allocation 주입, repeated eigenspace projector 및 세 반복 재현성 evidence는 미확인이다.
- 메인이 전달한 최신 source checkpoint는 `22c9d44`이며 configured full runner는 **395개 중394 통과, 원본 eigen 1개 실패, 155.31초**다. Input/FEAST/procedure/writer focused41은 새 density·unit scaling을 포함해 모두 통과했다. 본 검토자는 실행 로그를 직접 재검증하거나 build/test를 실행하지 않았다. 필수 reference/physics 완료는 승인하지 않는다.
- 최초 원본 eigen 실행의 10669ms 뒤 column20 `eigenpair-validation-failed`는 위 actual rerun의 full/upper residual·loop/epsout evidence로 구체화됐다. 필수 reference/전체 기능의 성공 판정은 할 수 없다.
- 이번 후속 수정은 본 보고서뿐이며 과거 검토 상세는 보존했다. 상위 계약·source·tests·writer·Git·reference는 수정하지 않았고 reference·제외 예제는 열람하지 않았다. 잔여 위험은 mandatory residual와 public static 계약 충돌, near-aligned forward accuracy, geometry 평가점 밖 injectivity 및 필수 coverage다.