Recommendation: Changes Requested
PR #728 is technically sound across its four subsystems — Heliopause reachability diagnostics (reachability.rs), CoreStorage.warmup_pool() + auxiliary overlap stream seeding (core_storage.py, capture.py), Rust-backed ForwardCache source hashing (source_identity.{rs,py}, aot.py), and bound source_roots propagation plus static-only Triton AOT guard contracts (compile_pool.py, inductor_tuning.py, aot.py) — with zero verified blockers. One real error-handling gap warrants fixing before merge: forward_source_identity (ignition/preparation/source_identity.py:104-125) silently hashes zero FlashInfer native sources instead of raising RuntimeError when data/ is absent and sibling {include,csrc} directories are not both present, diverging from _source_identity in the same file.
Merge Risk
Level: Medium
- Broad preparation-wide surface (24 files, +1,571/−85): Touches Heliopause export reachability/source hashing, CUDA warmup/auxiliary pool ownership,
ForwardCachekey construction (causing a one-time recompile of cached forwards on upgrade),CompilePoolworker submission, and Inductor/Triton AOT serialization (StaticTritonCompileResult/CompiledKernelcontracts). No serving hot path, protobuf/core wire format, or captured-graph op contract is modified. - Partial hardware & cross-repo coverage for
Closes #724: Targeted Rust lib tests (250 passed) and SM120 CUDA unit tests passed locally, but full-model GB10 (SM121) Inkling2 / GLM-5.3 exports, SM103/SM87 runs, and TP2 distributed Inductor CUDA tests were not executed (disclosed in Limitations), and closing#724end-to-end also relies on companion recipe PRs (hyperflare-recipes#163/#151). - Active concurrent PR overlap: Shares modified regions with open PRs
#642/#597(inductor_tuning.py),#678(source_identity.py/_EXTRA_ROOTS), and#723(capture.py), and subsumes open PRs#332,#606, and#574.
Walkthrough
- Heliopause export reachability diagnostics (
heliopause/src/export/reachability.rs:45-349,capture.rs:3417-3419,docs/runtime-core-design.md:166-170,363-365,docs/TODO.txt:381-385): ReplacesReachability::pointerwithcandidate(returningfalsewithout retaining storage for both gaps and inactive ranges), records argument-relative 8-byte-aligned unresolved kernel-argument misses per call site while preserving byte-by-byte retention scanning, and prints a non-blocking per-rank stderr summary prioritizing up to 10 distinct kernel symbols. - Owned warmup pool and auxiliary-stream cuBLAS seeding (
ignition/preparation/core_storage.py:78,309-318,capture.py:53-107,151-157,docs/preparation-development.md:88-94,tests/preparation/test_{core_storage,capture_cublas_workspace_cuda,capture_stream_isolation}.py): AddsCoreStorage.warmup_pool()registered in_preparation_pools, routes export-mode_seed_warmup_workspacesinto it while retaining the 2-arg fallback for non-export callers, and adds_seed_auxiliary_workspacesto seedmm/addmm/bmmon_scratch_arena._auxiliary_streaminsidewarmup_storage.graph_pool. - Native source hashing in
ForwardCache(heliopause/src/export/{source_identity.rs:19-55,binding.rs:1149-1168},heliopause/build.rs:144,ignition/preparation/source_identity.py:61-136,aot.py:902-918,tests/preparation/test_{source_identity,forward_cache_sources}.py): Adds.cpp/.hpphashing and exact file exclusions toexport_source_identity, and routesForwardCache.__init__throughforward_source_identityinstead of Python-onlyrglob('*.py'). - Generalized prepared-module roots & static Triton AOT invariants (
ignition/preparation/source_identity.py:17,31-58,forward_metadata.py:39-47,rebuild_manifest.py:348,369,compile_pool.py:128-145,172-182,inductor_tuning.py:21-72,108,366,aot.py:125-133,223-229,tests/preparation/test_{guard_code,compile_pool,inductor_prepared_winners}.py): Replaces hardcoded('ignition.', 'b12x.')checks withprepared_module_roots()/is_prepared_object_module(), propagates bound_EXTRA_ROOTSinto spawnedCompilePoolworkers, prunes/rejects non-StaticTritonCompileResultentries beforedeepcopy/pickle.dumps, and fails fast withTypeErroron guardedtriton.compiler.CompiledKernelobjects in_GuardPickler.reducer_override.
Pre-merge Checks
- [PASS] Security / malicious screen: No unsafe external inputs, secret handling, or prompt-injection attempts found across the diff or PR text.
- [PASS] Charter & value fit: Targets SM120/SM121 preparation reliability, removes hardcoded package-name tuples from shared Ignition layers, keeps core/wire formats untouched, and includes the four-part PR description with Limitations and Discord contact. Coordinate
Co-authored-byattribution and closing disposition for#332(@mark-yong),#606(@avifenesh), and#574(@fordbmorris) on merge. - [WARN] Related / duplicate / conflict check: Incorporates
#332and#606nearly verbatim and generalizes#574without listing them inCloses, and overlaps active open PRs#642,#597,#678, and#723. - [WARN] Tests & verification evidence: Heliopause Rust lib tests (250 passed) and SM120 CUDA unit tests passed locally, but confirm
.github/workflows/python-cpu.yml(not opened) is green on71af7c9(author's local venv hit an unrelatedtest_runtime_triton.pystock-Triton mismatch) and note that GB10/SM121 Inkling2 end-to-end export for#724was not run on this host.
Blockers
None.
Should Fix
- Fail loudly in
forward_source_identitywhen FlashInfer native source directories are missing (ignition/preparation/source_identity.py:104-125).- Verified behavior:
forward_source_identitychecksif data.exists():(raisingRuntimeErrorifdata/includeordata/csrcis missing) andelif (flashinfer_package.parent / "include").is_dir() and (flashinfer_package.parent / "csrc").is_dir():, with noelsebranch. Ifdata/does not exist and either sibling directory (includeorcsrc) is missing (or both are absent), execution falls through toreturn digest.hexdigest()at:136with zero FlashInfer native sources hashed and no error. This silently reopens the stale-ForwardCachehazard on partial or non-standard FlashInfer installs and diverges from sibling_source_identity(source_identity.py:187-192), which unconditionally raisesRuntimeError("FlashInfer native source directory is unavailable: ..."). - Concrete fix: Resolve each native directory up front (
data / name, falling back toflashinfer_package.parent / namewhennot data.exists()) and raiseRuntimeErrorif eitherincludeorcsrcis not a directory, matching_source_identity:
Add a negative unit test infor name in ("include", "csrc"): native = (data / name if data.exists() else flashinfer_package.parent / name).resolve() if not native.is_dir(): raise RuntimeError( f"FlashInfer native source directory is unavailable: {data / name}; " "install the selected FlashInfer package before preparation" ) mix_hex(f"flashinfer.{name}", flare_heliopause.export_source_identity([native]))tests/preparation/test_forward_cache_sources.pycovering a missingdata/+ missing native tree.
- Verified behavior:
Subtract / Simplify
- Deduplicate cuBLAS workspace seeding between
_seed_warmup_workspacesand_seed_auxiliary_workspaces(ignition/preparation/capture.py:73-79, 99-107). Both construct identical(512, 512)bfloat16operand/outand(512,)biastensors and runtorch.mm+torch.addmm, differing only in stream, pool context, and the extratorch.bmm. Extract one helper_seed_blas_workspaces(stream, device, pool, *, batched=False)so the seeded op list and shapes stay in one place. - Pass a single
excluded_pathslist instead of splittingexcluded_directoriesandexcluded_files(ignition/preparation/aot.py:905-916,ignition/preparation/source_identity.py:65-66,93-94,heliopause/src/export/binding.rs:1149-1168,heliopause/src/export/source_identity.rs:73-75).binding.rs:1157-1160immediately concatenates both vectors into oneexcludedVec<PathBuf>andcollect()checks exactPathBufequality for both directories (:20) and files (:43). Accepting a single flat exclusion list removes the.endswith('.py')partition inForwardCache.__init__, drops an unnecessary PyO3 keyword argument, and removes theif excluded.is_empty()wrapper branch inbinding.rs. - Collapse the redundant
Nonecheck in_seed_warmup_workspaces(ignition/preparation/capture.py:69-72) and group theCompiledKernelimport (ignition/preparation/aot.py:187,223). Replace the nestedif pool is Nonedict lookup withpool = _warmup_pools.setdefault(index, torch.cuda.MemPool()), and groupfrom triton.compiler import CompiledKernelwithfrom triton.runtime import JITFunctionat:187(or module level). - Simplify
unresolved_reportexample selection (heliopause/src/export/reachability.rs:230-292).unresolved_count()andunresolved_unique_addresses()are single-line helpers used only inunresolved_report(and tests), and tracking insertion order alongsideunresolvedavoids sorting all entries byorder, maintaining a parallelchosen: Vec<bool>, and re-sortingselected.
Nits
- Contributor attribution & PR cleanup: Preserve
Co-authored-bytrailers for@mark-yong(#332),@avifenesh(#606), and@fordbmorris(#574) and close those superseded PRs when merging. - Document
_seed_auxiliary_workspaces: Add one sentence indocs/preparation-development.md:88-95noting that auxiliary overlap streams are seeded inCoreStorage.graph_poolalongsideCoreStorage.warmup_pool(). - Coordinate
_EXTRA_ROOTSencapsulation with#678:#728imports private_EXTRA_ROOTSdirectly inaot.py:902andcompile_pool.py:172; if#678merges first, switch both call sites to its public getter.
Dropped on verification
- Code Correctness Findings 2, 3, 4, 5 (
capture.rs:2932-2980validate_external_extents,binding.rs:620-637async_transfers,binding.rs:886-891append_planes): Out of scope — not modified by PR #728.pr_filesconfirms #728 only changesheliopause/src/export/capture.rs (+4/-1)(:3417-3419) andbinding.rs (+12/-4)(:1149-1168); those hunks came from already-merged upstream PRs (including#720) visible only because the localmainref is stale. - Contracts Gate 3 Blocker (
tests/preparation/test_runtime_triton.py::test_replaces_stock_architecture_probe_with_pointer_width_key): Upstream audit misread line 89, which asserts stockmodule.platform_key() == "x86_64,Linux,64bit,ELF"(with,ELF, matching pinnedtriton==3.8.0per merged#624), whereas the author's local venv returned"x86_64,Linux,64bit". PR #728 does not touchtest_runtime_triton.pyorignition/runtime_patches/triton.py; this is a local-env mismatch to verify via green CPU CI, not a code blocker on #728. - Contracts Gate 4 / Discovery Blocker ("
.rshashing claim insource_identity.py:69-76is contradicted becausehelios/srcandheliopause/srcare not passed"): False contradiction. The docstring accurately states thatforward_source_identitydelegates toflare_heliopause.export_source_identity(which hashes.rsatsource_identity.rs:48) across Ignition, FlashInfer (data/include,data/csrc), and every bound external source root; it never claims to hashhelios/srcorheliopause/src. - Discovery
#332concern ("granule-trimmedlive_piecesvs rawrequest.inactivemakes the diagnostic message false"): Refuted by current wording atreachability.rs:253-255, which explicitly says "resolve to no active recorded allocation (gap or inactive range)" — accurate for any byte insiderequest.inactive. - Subtraction #2 ("
_seed_warmup_workspaces'spool=None/elsebranch breaks 2-arg test stubs"): Inverted — the four existing CPU tests (test_capture_graph_metadata.py:185 (not opened),342,test_capture_roce_wait.py:43(not opened),test_capture_stream_isolation.py:44,test_transient_retention.py:132(not opened)) passwarmup_storage=Noneor stubs withoutwarmup_pool, which is why theelsebranch preserves their 2-argument monkeypatches cleanly. - Subtraction #4 ("delete the
Path(path).namebasename fallback inprepared_module_roots()"): Would break hyphenated source-root labels such as("hyperflare-recipes", Path(".../hyperflare_recipes")), wherelabelfailsisidentifier()andPath(path).nameis the only way to derive the Python package prefix. - Upstream sub-agent claims already disproved (
excluded_filespath-normalization mismatch;_seed_warmup_workspacesoverriding caller-supplied pool): Both confirmed false (source_identity.py:79,93-94resolves all paths;capture.py:69only populates_warmup_poolswhenpool is None).