InsightSoftwareConsortium / InsightSoftwareConsortium/ITK

Proposal: content-addressed CastXML cache to accelerate Python wrapping builds (parked PR #6533)

Open
#6,566 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.7k
Forks
748
Avg merge
1d 1h
Merged PRs (30d)
64

Description

**TL;DR:** PR #6533 adds a content-addressed cache for CastXML output (plus two latent pkl-tracking correctness fixes) to the Python wrapping pipeline. Measured on ITK's own CI: **~31 min saved per 2-core Azure Python build** (median 175 → 144 min, −18%; best same-code pair −20%), up to −64% on cold GHA runners when combined with ccache, and the same benefit applies to warm local rebuilds on low-core machines. Populating the cache costs nothing (cold runs match the no-cache median).

The implementation is complete and validated — a 49-test cross-platform suite runs as a `WrappingInfrastructure` ctest on the Linux/macOS/ARM Python CI legs, and all checks are green — but it is a nontrivial change to wrapping infrastructure and deserves deliberate review, not a drive-by merge.

**Status: parked.** The PR is closed as a draft side-quest and will only move forward if there is community interest in reviewing and accepting the approach. If this would help your CI or local wrapping builds, please comment here or on #6533.

How it works (one paragraph)

A transparent wrapper around the CastXML binary keys each invocation two ways: L1 = hash of the inputs (binary content, `.cxx`, include flags) for an instant hit with dependency + include-dir validation, and L2 = hash of the preprocessed translation unit (`castxml -E`, line markers stripped), which is path-independent so any build tree on the same source shares entries. Hits restore the gzipped XML output; misses run CastXML and store it. Concurrency-safe, size-capped with eviction, wired into the Azure/GHA CI caches. Full measurements and design details in the PR #6533 description.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing PR #6533 and its design details, then inspect the wrapping implementation and validation suite under Wrapping/Generators/Tests/. The 49-test WrappingInfrastructure ctest and Linux, macOS, and ARM Python CI legs define the reported validation target; done means the approach is reviewed, rebased or reopened, and those checks remain green.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
build-system, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.