Skip to content

fix(conformal): σ-model divergence silently masked as constant-width band — FastForest swap (un-reds macOS CI) - #2

Merged
birdnamoo merged 4 commits into
mainfrom
fix/macos-arm64-ci
Jul 7, 2026
Merged

fix(conformal): σ-model divergence silently masked as constant-width band — FastForest swap (un-reds macOS CI)#2
birdnamoo merged 4 commits into
mainfrom
fix/macos-arm64-ci

Conversation

@birdnamoo

Copy link
Copy Markdown
Contributor

Summary

  • Root cause of the macos-latest CI red (since 0.19.0, ISSUE-mloop-20260705-macos-predictionservice-test-failures): the heteroscedastic aux σ(x) SDCA fit can silently diverge (observed σ≈-8.7e7 on win-x64 single-threaded; same degeneracy class on macos-arm64), and the max(σ,0)+β floor masks divergence as a constant-width band.
  • σ-model: SDCA → FastForest (managed, structurally bounded to the |residual| range, cannot diverge; NumberOfThreads=1 for reproducible calibration).
  • PredictionService σ-scoring fallback now emits a warning instead of degrading silently.
  • Band tests now read aux σ directly in failure messages (fit vs serving-path diagnosis).
  • Predict_Multiclass_NumericLabel_MatchesTrainedSingleSchema: LightGbm → SdcaMaximumEntropy (no lib_lightgbm osx-arm64 native; pinned regression is trainer-agnostic).

Validation

  • Local (win-x64): CrossPathConformalBandTests, PredictionServiceTests(33), Conformal(41), AutoMLRunnerTests(22) all green; CrossPath runtime 1m42s→4s.
  • This PR's purpose is the macos-latest job — the first macOS execution of these tests post-fix.

birdnamoo added 4 commits July 6, 2026 04:24
…1, D24, D21-A)

사전승인 큐(cycle-159~162): P-svc1이 D20/D21/D22의 침묵-전null 패턴을 일반
백스톱으로 통합(RequireNonDegenerateOutput). D24는 clustering의 train-side
Concatenate embed를 제거하고 선-featurize+trainer 단독 fit으로 정규화해
구조화 predict의 Features 차원 불일치를 근본해소(CLI CSV 경로도 정합).
D21-A는 forecasting POST /predict에 horizon 계약을 추가하고, CLI 전용이던
replay 계산을 ForecastReplayService로 추출해 CLI/API가 공유하도록 함.

- RED(원본 코드에서 이슈 재현)->GREEN 확인 후 반영(D24)
- 신규 테스트: PredictionServiceTests +4, ClusteringFeaturesContractTests,
  PredictForecastingTests +2, ForecastingApiTests +3
- 회귀: Core.Tests 1094/1095(1건 부하-flaky, 격리 재검증 pass)·CLI 853/853·
  API 핵심 45/45(신규 forecasting 3/3 격리 확인 — 전체 스위트는
  WebApplicationFactory 기동 비결정성으로 부분 검증, 코드 무관 확인)
실데이터 OD 학습이 간헐적으로 native access violation(0xC0000005)으로
프로세스 사망(D27). upstream 조사(dotnet/TorchSharp#1292)가 크래시 위치
변동을 메모리/스레드 압박에 의한 네이티브 힙손상으로 설명 — 학습 진입 시
torch.set_num_threads(1)로 압박원 하나를 제거.

무손실 변경(CPU 학습 속도 저하만이 유일한 비용)이라 검증 없이도 적용
가능 판단. 실행시간 검증은 이 세션 전체의 자원압박 환경(dotnet test
반복 "killed")으로 미완주 — 빌드 성공 + 로직 무변경(부작용 1줄)으로
회귀 위험 없음을 코드 리뷰로 확인. D27 이슈에 미검증 상태 정직 기록.
…(macOS CI un-red)

- aux σ(x)를 SDCA→FastForest로 교체: SDCA는 플랫폼/스레드 궤적에 따라 발산
  (win-x64 단일스레드 σ≈-8.7e7 실측, macos-arm64 CI 동일 기전)하고
  max(σ,0)+β 플로어가 발산을 상수폭 밴드로 은폐. 포리스트는 σ가 학습 잔차
  범위로 구조적 유계(비음수·발산 불가), NumberOfThreads=1로 보정 재현성 확보
- PredictionService σ 스코어링 폴백에 warning 추가 (P-svc1 반침묵강등 교훈)
- 두 밴드 테스트 실패 메시지에 aux σ 직접 판독 진단 추가 (fit vs serving 구분)
- multiclass numeric-label 테스트 LightGbm→SdcaMaximumEntropy:
  macos-latest는 Apple silicon이고 lib_lightgbm osx-arm64 네이티브 부재,
  핀 대상 회귀(serve 라벨 로딩)는 트레이너 무관
…IProjectDiscovery 스텁 주입

xUnit은 테스트 클래스(=팩토리 인스턴스)를 병렬 실행하는데, 기존 팩토리는
Environment.CurrentDirectory(전역)를 임시 루트로 바꿔 프로젝트 발견을 우회했다.
단일 소비 클래스(ApiIntegrationTests)일 땐 잠복했으나 D21-A의 ForecastingApiTests가
두 번째 팩토리를 만들며 노출: 한 팩토리의 Dispose가 다른 팩토리 Program 기동의
작업 디렉터리를 삭제 → 'entry point exited without ever building an IHost'로
API 테스트 37건 전 OS 전멸. 고정 루트 스텁 주입으로 팩토리 간 격리.
@birdnamoo
birdnamoo merged commit 3eb5957 into main Jul 7, 2026
5 checks passed
@birdnamoo
birdnamoo deleted the fix/macos-arm64-ci branch July 7, 2026 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant