---
title: "2026-09-01 clinical ve2e direct PI CAI adapter commits"
description: "Finalized and committed canonical preprocessing and the validated direct PI-CAI data adapter."
image: "https://docs.virdx.dev/img/virdx-social-card.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.virdx.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 2026-09-01 clinical ve2e direct PI CAI adapter commits

## Work Done

- Audited the complete uncommitted `feat/isup-inference` diff and split it into two append-only commits.
- Moved canonical volume preprocessing into the lightweight public module `ve2e.data.preprocessing`, exported `preprocess_volumes` from `ve2e.data`, and updated all repository references. Commit: `2ccb734b` (`refactor: expose volume preprocessing`).
- Added generic `Inference` and `DataAdapter` contracts, introduced `PICAIDataAdapter`, removed the obsolete DataModule-based `picai/data.py` path, and wired the benchmark to the direct adapter. Commit: `02b2fe4a` (`refactor: separate PI-CAI data adapter`).
- Preserved strict biopsy/RPE target provenance and deleted the duplicate legacy path rather than keeping compatibility shims.
- Validated with Ruff, formatting, compilation, MyPy on 92 Linux source files, complexity analysis, diff checks, calldiff, independent fresh-context review, public import smoke checks, and the CUDA test suite: 274 passed and 1 skipped.
- The full direct-path PI-CAI Argo benchmark remained active after privacy-safe 128-request parity had already shown identical fields and zero maximum absolute input difference for all 33 eligible cases.

## Lessons Learned: Pitfalls

- A passing abstract-base typecheck did not prove the constructor contract was substitutable; Python ABCs accept an incompatible subclass constructor by name.
- Exporting preprocessing directly from `clinical_dataset` through `ve2e.data` pulled heavy dataset and augmentation dependencies into every package import. Moving the function to a lightweight module avoided that import-side regression.
- Calldiff could identify the deleted benchmark path but did not expand the untracked replacement adapter, so it had to be paired with search, typecheck, and fresh-context review.

## Lessons Learned: Improvements

- Define public preprocessing primitives in dependency-light modules from the start, then make datasets consume them rather than promoting helpers in dataset implementations.
- Generic inference bases should describe only behavior shared by every task. Task-specific model identity and setup should not be forced into a misleading constructor abstraction.
- Document that ve2e's full validation route is Linux Pixi `dev` for MyPy and `cuda-dev` for imports/tests; macOS can still run Ruff, compilation, diff, and complexity checks.

Source: https://docs.virdx.dev/knowledge/inbox/2026-09-01-clinical-ve2e-direct-picai-adapter-commits/index.mdx
