Changelog¶
Session-by-session summary of the port. The session numbers (S0, S3, …)
match memory/handover_session.md / memory/mental_note.md entries in
the repo. Dates are approximate (the port has run through May 2026).
Phases below are coarse-grained groupings of related sessions.
Phase 1 — Bootstrap (S0–S2)¶
- S0: Repository layout, CMake skeleton,
upstream/read-only symlink toalicevision-windows/AliceVision. - S1:
cmake/Metal.cmake—.metal → .air → .metallibpipeline. - S2:
av::gpuLayer 1 —Device,Buffer,Texture,Pipeline,CommandBuffer,Errors. Pure metal-cpp; no Objective-C++.
Phase 5 — Numerical primitives (S3–S8)¶
- S3:
Eig33— Householder + QL on 3×3 symmetric matrices. FP32 port of upstream FP64 algorithm. Worst eigenvalue rel err 2.71e-6. - S4-S7:
MatrixOps,PatchOps,ColorOps,SimStatOps,CompNCC. All validated against CPU references with1e-5rel budget. - S8:
ImageColorConversion(sRGB → Lab × 2.55 preservation; the classical-vs-upstream-Lab gotcha lands here).
Phase 6 — Image processing (S9)¶
- S9:
GaussianFilter(downscaleWithGaussianBlur,medianFilter3). Custom mipmap cascade (deviceMipmappedArray.cu) deliberately deferred — Metal's built-ingenerate_mipmaps()substitutes.
Phase 7 — SGM / Refine / Optimize (S10–S25)¶
- S10-S14: SGM core kernels —
init_sim,compute_similarity,optimize(4-direction DP),retrieve_best_depth. - S15:
test_sgm_pipeline— first end-to-end SGM run on a synthetic plane-induced-homography scene. - S16-S18: Refine kernels —
init_refine,refine_similarity(FP16),refine_best_depth. End-to-endtest_refine_pipelinein S18. - S20:
smooth_thickness— first sub-FP32-ULP drift case (-ffast-mathfusesfmax/fminintoclampintrinsic). - S21: SGM→Refine bridge (
compute_sgm_upscaled_depth_pix_size_map). - S22:
compute_normal—Stat3dFP32 PCA accumulators (replacing upstream's FP64). Worst cos deviation 1.81e-5. - S23, S24:
optimize_depth_sim_map— chained-sigmoid blend. First case needing a relaxed budget (1e-3sim) under-ffast-math. S24test_depth_pipeline: full SGM → Bridge → Refine → Optimize on a 128×96 fused scene. 87 % valid, 94 % lock-on within 1.5 SGM steps. - S25: Multi-T-camera aggregation (WTA cost + FP16 additive refine).
Phase 8 — Host orchestration (S26–S31)¶
- S26:
DeviceMipmapImage— working-texture indirection for multi-mipaccess::read_writesemantics. - S27:
LRUCache<T>+DeviceCache. Header-only template port of upstream's slot-stable LRU. - S28:
DeviceStreamManager— multi-MTLCommandQueuepool with negative- index wrap. - S30: First upstream module compiled (
aliceVision_image). - S31: Adaptive-P2 SGM path (4
_fcvariants ofvolume_optimizekernels).DevicePatchPatternbyte-identical (868 B) across MSL + host.
Phase 8b — Adapter forwarders (S33–S38)¶
- S33-S35:
upstream_adapter.hppskeleton; 12 (later 15)cuda_*symbols declared. - S36-S37: Type-shim layer for
CudaDeviceMemoryPitched<T, N>,CudaSize<N>,float2/3/4,__half,cudaStream_t. - S38: First
aliceVision_depthMapEstimationbinary builds + links. Eight pipeline binaries built:importMiddlebury,cameraInit,featureExtraction,imageMatching(target_bin),featureMatching,incrementalSfM,prepareDenseScene,depthMapEstimation. 19 upstream modules built. libc++ /vector<T>::reserveinstantiation patch lands.
Phase 9 — End-to-end pipeline (S39–S40)¶
- S39: Full SfM cascade runs on Monstree mini3 —
cameraInitthroughprepareDenseSceneproduces 7,430 landmarks. depthMap hangs at "Retrieve best depth in volume" due to conditionally-allocated null pointer. - S40: Two-bug cascade fix in
cuda_volumeRetrieveBestDepth:maxSimilarity × 254+1.f + depthThicknessInflate. Monstree mini3 now produces real depth maps (Min=-2, Max=20-22, Avg≈3-4 on the SfM-reported range). 8 pipeline binaries shipped.
Phase 10 — Mesh reconstruction (S41)¶
- S41: Meshing pipeline lands clean —
aliceVision_depthMapFiltering,aliceVision_meshing,aliceVision_meshFiltering,aliceVision_texturing. ZERO CMake-time patches needed (everything compiled against the existing shim path). 12 pipeline binaries shipped. 32 upstream modules. Adapter audit (memory/adapter_audit_s41.md). - End-to-end deliverable: Monstree mini3 → texturedMesh.obj + .mtl + 8192² PNG atlas. Total wall-clock ~1 min on M4.
Phase 11 — Meshroom integration (S42)¶
- S42: 4 Darwin patches against upstream Meshroom land
(
init-darwin-libpath,stats-darwin-gpu,cgroup-darwin-sysctl,startsh-readlink-portable). 2 patches against AliceVision node descriptors (ABC → SfM / PLY for the no-Alembic build).scripts/run_meshroom.shwraps the env vars Meshroom expects.meshroom-mac/working copy +meshroom-venv/ship in-tree.
Phase 12 — Release engineering (S46)¶
- S46:
Formula/alicevision-for-mac.rbHomebrew formula. CMakepackagetarget producesbuild/release/*.tar.gz. Ad-hoc codesign viainstall(CODE ...)blocks.phase12_install_smoke.shexercises the install + tarball path. Tarball is not fully vendored — Homebrew runtime dylibs expected on consumer machine.
Phase 14 — Performance profiling + optimization (S43–S45)¶
- S43:
AV_PROFILE_ADAPTERoption lands. Per-forwarder timing accumulator (RAIIScopeTimer+ atexit-flushed sorted table). Baseline profile on Monstree mini3 view 0: adapter total 14.5 s,cuda_volumeOptimize63 %. - S44:
cuda_volumeOptimize— batch all dispatches per SGM path onto one command buffer + encoder. -49.6 % (9.16 s → 4.62 s). - S45:
cuda_volumeComputeSimilarity— threadgroup reshape from{16, 4, 1}to{4, 2, 8}(Z-coherent texture cache hits). -65.0 % (3.26 s → 1.14 s). Adapter total 12.4 s.
Phase 15 — Native SwiftUI app (decommissioned 2026-05-23)¶
An earlier track shipped a parallel native SwiftUI Meshroom frontend at
meshroom-native/ (M1–M6 milestones, 115 Swift tests). It was retired on
2026-05-23 to consolidate work on the upstream-compatible PySide6
Meshroom: maintaining two graph editors against an evolving upstream node
schema doubled review surface for marginal user benefit. The Swift code,
tests, scripts, and per-page documentation have been removed.
S52–S54 — AI segmentation & macOS Qt UI fixes¶
- S52:
SegmentationBiRefNetMeshroom node landed (rembg + ONNX Runtime CoreML EP, withONNX_FORCE_CPU=1escape hatch for the brokenCPUAndGPUpath onswin_v1). - S53: native plugin system at
plugins/—plugin.jsonmanifests consumed viaMESHROOM_NODES_PATH. - S54: macOS Qt UI fixes for meshroom-mac (semaphore leak via
ThreadPoolExecutor, RHI backend pinned to Metal, Qt3D deferred behindMESHROOM_ENABLE_VIEWER3D=1,PrepareDenseScene.sizeusesDynamicViewsSize). - 2026-05-23: pre-converted BiRefNet
.mlpackagemodels added atai-models/; conversion pipeline atmodels/. ANE found to be not viable for this graph (deformable conv v2 lowered viagrid_samplecannot be planned by the ANE compiler);MLComputeUnits.cpuAndGPUis the production target on Apple Silicon.
Phase 13 + 14 — Feature parity sprint (2026-05-23 → 2026-05-24)¶
Brought the port from 12 to 60 binaries and from 4 of 25 to 25 of 25 covered Meshroom templates in nine focused phases. Full per-phase notes are in the top-level CHANGELOG.md; high-level recap:
- Phase 14.1 — 6 modern-SfM binaries (
sfmBootstrapping,sfmExpanding,relativePoseEstimating,sfmTriangulation,tracksBuilding,meshDecimate) - a CMake-time inline patch for
relativePoses.hpp(ODR fix). - Phase 14.2 — 3 HDR binaries (
LdrToHdrSampling,LdrToHdrCalibration,LdrToHdrMerge).hdrFusiontemplate covered. - Phase 14.3 — 8 panorama binaries + bonus
sfmTransform.panoramaHdr panoramaFisheyeHdrcovered.- Phase 14.4a —
lightingCalibration+photometricStereobinaries + 2 photometric sublibs. OpenCVfind_packagewired in. - Phase 14.4b — CoreML port of
sphereDetection(replaces upstream's ONNX Runtime). Newsrc/sphere_detection/module wrappingai-models/yolov8n.mlpackage. Runs on ANE (3× faster than GPU). - Phase 14.5 — 21 utility + lidar binaries via parallel agent dispatch.
6 templates flip to covered (
colorCalibration,distortionCalibration,lidarMeshing,photogrammetry,photogrammetryObjectTwoSides,rawImageConversion). - Phase 14.6 — Alembic enabled in the existing
sfmDataIOsublib by settingALICEVISION_HAVE_ALEMBIC=1BEFOREadd_subdirectory. 2 binaries (exportAlembic,exportAnimatedCamera); 8 cameraTracking-family templates flip to covered. - Phase 14.7 — 3 Mac-port-native binaries at
src/native_binaries/for 2026.1.0 features upstream defers to Python pipelines:starListing(algorithmic),matchMasking+moGe(honest stubs). Coverage 25/25 in the matrix sense. - Phase 14.8 — CoreML port of
moGe(replaces Phase 14.7 stub). Newsrc/moge/module wrappingai-models/moge2_504x672_t1728.mlpackage(DINOv2 ViT-B/14). Real per-view depth + normals at 504×672. Runs partially on ANE (~228 ms vs ~384 ms CPU). - Phase 14.9 — CoreML port of
matchMasking(TinyRoMa, replaces Phase 14.7 stub). Newsrc/roma/module wrappingai-models/tiny_roma_v1_480x640.mlpackage. CRITICAL: usesMLComputeUnitsCPUAndGPU(not.all) — ANE is 4× slower here due togrid_samplehandoffs. Zero honest stubs remain. - Phase 13 — Native
pyalicevisionSWIG bindings (hdr,sfmData,sfmDataIO) replace the pure-Python stubs whenAV_BUILD_PYALICEVISION=ON. Auto-discovery via__path__manipulation; falls back to stubs when off. Critical macOS gotcha: must pass-DLINUXPLATFORMto SWIG to avoid asize_ttypedef mismatch with__darwin_size_t.
Current state (2026-05-24)¶
- 60 pipeline binaries, ARM64 native, codesigned.
- 32 upstream modules + 7 new sublibs compiled (panorama, hdr, photometricStereo, lightingEstimation, calibration, keyframe, imageProcessing).
- 3 native ML wrapper modules (sphere_detection, moge, roma) + the segmentation Python plugin.
- 41 MSL kernel entry points.
- 15
cuda_*adapter forwarders, audited. - 37/37 C++ tests pass under
ctest -j8. - 73 passed / 25 skipped in
pytest tests/python(gated heavy E2E behindRUN_*=1env vars). - 4 CoreML models at
ai-models/: BiRefNet × 2 (cpuAndGPU), YOLOv8n (.all/ ANE), MoGe-2 (.all/ partial ANE), TinyRoMa (cpuAndGPU— ANE is a regression). - 25 / 25 Meshroom templates covered.
- 4 templates E2E-verified end-to-end on Monstree mini3 in ~1 min on M4.
- Self-contained
.appbundling (155 MB dylibs) + DMG packaging shipped.
Roadmap¶
For the remaining 21 covered-but-load-only templates to be E2E-verified,
fixture datasets are needed (HDR brackets, calibration spheres, LIDAR
.e57s, checkerboards, RAW images, calibrated video footage, etc.).
That's data collection, not code.
Code-side items still open:
- Developer-ID notarization (
scripts/codesign_macos_app.sh --identitypath). - Unified
aliceVisionbinary with subcommand dispatch. - Custom mipmap cascade to bit-match upstream
deviceMipmappedArray.cu. - Roma at FP32 for sub-1% argmax-sensitivity diff (currently FP16, 2.3% rel max).