Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Reading rules:
| NVlabs/kda @ `acdd79343c5e9d0c7cb96289f26fd3f1051ce785` → mit-han-lab/KernelWiki gitlink @ `76d27b56f804e7e7295d4c570e1e5d7eef4b0a75` | Direct bounded distillation, 2026-10-23; cutoff 2026-04-27. All 48 synthesis headers and 2,217 source headers screened; 171 SM90 source headers retained, selected bodies and independently matched DeepGEMM/CUTLASS code plus versioned NVIDIA sections inspected. [Readset/coverage/license qualifications](../src/inferrsi/data/skill_library/hardware/cuda/reason-hopper-kernels/references/sources.md); remaining PR bodies/algorithms unmined; KW pin has no root LICENSE, KDA MIT/sanitization assertions qualified | mined (conditional) — Hopper TMA/mbarrier/WGMMA ownership, resource/layout/pipeline/software scheduling and selected FP8 scaling → [reason-hopper-kernels](../src/inferrsi/data/skill_library/hardware/cuda/reason-hopper-kernels/SKILL.md); SM100 recipes and unsafe snippet generalizations excluded; native/precision/performance not_run | out-of-scope — device registers/SMEM/HBM are not host RAM | out-of-scope — no storage implementation extracted | out-of-scope — CTA/cluster synchronization is not network transport | out-of-scope — tile scheduling is not OS scheduling |
| antirez/h3.c @ `8974cc055ea9c02fcd14cc27dfda3e1027c05153` (MIT; retained ccv BSD-3-Clause notice) | Direct bounded source distillation, 2026-10-23; 34 selected file bytes matched to pinned Git blobs; [readset/architecture](../src/inferrsi/data/skill_library/repositories/h3-c/audit-h3-runtime-residency/references/source-notes.md). Loader, generation/cache, TE/vision/input-output VAEs, AdaLN, selected Metal/int8/SSD paths and native test assertions; full kernels/driver/media internals unread. Prior model-header observations reused, not rerun | mined — joint audio/video schedule and row-map dependencies, BF16 rounding/fusion versus numerical approximation, actual TensorOps dispatch → [audit-h3-runtime-residency](../src/inferrsi/data/skill_library/repositories/h3-c/audit-h3-runtime-residency/SKILL.md); native/quality/performance not_run | mined — shared/file-backed weights, Qwen prefetch ring, phase/cache/preview overlap and complete host output; tensor counters are not physical footprint or 64 GiB qualification | mined — exact raw BF16/F32 schema, direct/mapped reads and two-slot BF16 matrix streaming with completion/join boundaries; uncached-read request is not measured cache bypass or useful overlap | out-of-scope — local GPU/I/O ordering is not network transport | out-of-scope — no OS scheduling/control implementation extracted |
| Comfy-Org/ComfyUI @ `b1a247c9cf9dbfda4b2c0a0c1d50950667eeaa0c` (GNU GPL v3) | Source-reading archive, inspected 2026-10-21; bounded execution/cache/graph/model-management/static-dynamic-patcher/sampler paths and selected tests; [readset](../src/inferrsi/data/skill_library/repositories/comfy-ui/references/repo-provenance.md); not full-model/custom-node/provider-native coverage | mined — managed weight/patch identity, partial unload versus detach and dynamic-backend boundary → [comfy-ui](../src/inferrsi/data/skill_library/repositories/comfy-ui/SKILL.md); device behavior unverified | mined — output versus object identity, ancestor fingerprints, lazy consumer references and retention versus validity; host/pin ownership | out-of-scope — no storage implementation extracted | out-of-scope — no transport implementation extracted | out-of-scope — workflow scheduling is not OS scheduling |
| leejet/stable-diffusion.cpp @ `b13a48219d5cdf408edcb93da6cd69b612ed03d3` (MIT) | Supplied fixed-revision archive, inspected 2026-10-22; 18 bounded readset paths plus one separately identity-checked README matched to pinned commit/tree (19 blobs total); header coverage is selected owner/state declarations; full archive/submodules not byte-authenticated; bounded image API, native runner, capacity, segment/prefetch and cleanup paths; [readset](../src/inferrsi/data/skill_library/repositories/stable-diffusion-cpp/audit-sd-cpp-residency/references/source-notes.md); GGML submodules/model kernels unread | mined — native weight/runtime capacity, protected segment/prefetch lifetime → [audit-sd-cpp-residency](../src/inferrsi/data/skill_library/repositories/stable-diffusion-cpp/audit-sd-cpp-residency/SKILL.md); native/backend behavior unverified | mined — parameter storage versus compute staging and retained runtime ownership; host peaks unmeasured | out-of-scope — demotion eligibility observed, complete loader/I/O not extracted | out-of-scope — device copies are not network transport | out-of-scope — runner scheduling is not OS scheduling |
| leejet/stable-diffusion.cpp @ `b13a48219d5cdf408edcb93da6cd69b612ed03d3` (MIT) | Supplied archive, inspected 2026-10-22: 18 bounded paths plus separately identity-checked README (19 blobs); historical receipt preserved. 2026-10-23 extension: 12 selected C++ blobs plus retained MIT text identity-checked, with line-scoped catalog/non-ZIP safetensors read/staging/mapping and immediate consumer cleanup; [readsets](../src/inferrsi/data/skill_library/repositories/stable-diffusion-cpp/audit-sd-cpp-residency/references/source-notes.md). File identity is not full-file review; archive/submodules, model kernels and other-format implementations remain outside the bounded audit | mined — native weight/runtime capacity, protected segment/prefetch lifetime → [audit-sd-cpp-residency](../src/inferrsi/data/skill_library/repositories/stable-diffusion-cpp/audit-sd-cpp-residency/SKILL.md); native/backend behavior unverified | mined — parameter storage versus compute staging and retained runtime ownership; loader host read/conversion buffers versus mapped owners; host peaks unmeasured | mined — bounded catalog stamps versus content identity, range admission versus actual reads, mapping/shared-owner and newly created block cleanup → [loader/storage boundaries](../src/inferrsi/data/skill_library/repositories/stable-diffusion-cpp/audit-sd-cpp-residency/references/loader-storage-boundaries.md); full other-format parsing, native failure/SSD/performance qualification remain open | out-of-scope — device copies are not network transport | out-of-scope — runner scheduling is not OS scheduling |
| NVIDIA/TensorRT-LLM @ f33e0e5fd | skill-doc-only (`.claude/skills/`) | mined — evidence taxonomy, kernel writing, casebook, roofline refs → `dense-performance-evidence`, `kernel-writing-guide`, `inference-optimization-casebook`, `performance-ceiling-analysis` | mined — host overhead verdict + line-profiling loop → `host-overhead-profiling`, `host-overhead-optimization` | mined — weight-movement/overlap + KV host-cache patterns → `weight-loading-optimization`; disk-level: negative (see below) | out-of-scope — host/device weight-movement overlap remains in RAM/Storage, not network coverage | mined — CPU affinity rule + env preflight → `os-process-placement` |
| Ascend/MindIE-SD @ 8481d39 | skill-doc-only (`.agents/skills/`) | mined — 5-layer analysis, bottleneck casebook → `ascend-performance-analysis`, `ascend-optimization-casebook` | mined — host-opt async/pattern sections → `weight-loading-optimization` | mined — load-path judgment, fixed-overhead accounting, offload tiers, weights-prep → `weight-loading-optimization` | mined — USP strategy, masking formula, topology rules → `ascend-distributed-parallel` | mined — device health, card-group contracts, measurement discipline → `ascend-device-health` |
| ascend-ai-coding/awesome-ascend-skills @ 75ec89c | full (`skills/`, `external/cannbot/`); incremental slice pinned to `75ec89ce9d401be8ac95980e1c3f42f8d4315057` | mined — graph mode, operator profiling/tuning, tiling design → `ascend-graph-mode`, `ascend-operator-profiling`, `ascend-operator-tuning`, `ascendc-tiling-design` | assessed/deferred — KV overview and async-stream recipe lack a complete transfer/completion implementation and retain cannbot license UNKNOWN; [boundary/readset](reviews/issue91-awesome-ascend.md#host-kv-boundary); no new RAM capability | mined — device-side prefetch + diffusers CPU-offload playbook → `weight-loading-optimization`; disk-level: negative | mined (wrapper-source only) — native/PyTorch test selection, tensor-byte meaning, timing/oracle coverage and rank-map counterexamples → `ascend-distributed-parallel`; [full-pin readset](../src/inferrsi/data/skill_library/hardware/ascend/ascend-distributed-parallel/references/awesome-ascend-communication-tests.md); no native-collective or transport audit | mined — env checks, device-busy preflight, thread/env tables → `os-process-placement` |
Expand Down
83 changes: 83 additions & 0 deletions docs/reviews/issue91-sd-cpp-loader-storage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Stable-diffusion.cpp catalog-to-storage construction

This bounded Issue #91 slice extends the existing
[`audit-sd-cpp-residency`](../../src/inferrsi/data/skill_library/repositories/stable-diffusion-cpp/audit-sd-cpp-residency/SKILL.md)
candidate. It preserves its stable ID, eight residency steps, MIT text, original
source pin and historical archive receipt. No engine, dependency, evaluator or
hardware execution is introduced. Material author: Codex / `gpt-6.1-sol`,
reasoning effort `xhigh`.

## Scope → ground → construct → verify

| AREX phase | Decision and native InferRSI asset |
|---|---|
| Scope | Fill the catalog/source → actual byte delivery → immediate storage-consumer gap. Select ordinary non-ZIP safetensors and its shard index; leave generic startup optimization with `weight-loading-optimization`. Do not replace request-time residency guidance. |
| Ground | Fixed leejet/stable-diffusion.cpp `b13a48219d5cdf408edcb93da6cd69b612ed03d3`, tree `df847d004c6529eefb02bb629d7ee26e740121a9`. Twelve C++ blobs and retained MIT text have exact byte identity checks; semantic ranges are in the [new ledger](../../src/inferrsi/data/skill_library/repositories/stable-diffusion-cpp/audit-sd-cpp-residency/references/loader-storage-boundaries.md#fixed-readset-and-attribution). The prior nineteen-blob receipt remains historical. |
| Construct | Reuse one owner and the native metadata/readers. Add [two loader/storage decisions](../../src/inferrsi/data/skill_library/repositories/stable-diffusion-cpp/audit-sd-cpp-residency/references/loader-storage-boundaries.md), a root route, additive source/validation notes and scoped entries in both matrices. No new ID, backend, counter or parallel registry is needed. |
| Verify | Check actual owner/resource discovery, metadata, local links, immutable source ranges and retained license. Preserve the old eight-step body and source identity. Bind generated records to a real source commit only after source freeze. Exact execution and independent-review receipts belong to the PR; package/schema checks do not qualify native loading or agent efficacy. |

AREX portable distill/extend guidance is used from fixed
`ac3fe1afa80fb9a09775ecfb2b6cc3ba850a2db6`; this is an InferRSI candidate extension,
not a managed-skill installation. The root license is MIT, Copyright (c) 2023
leejet, retained as the complete existing owner `LICENSE` (Git blob
`56e1e5a63852c3bcd5ac4fcdfecb7666f5274169`). No runtime implementation is copied;
this attribution does not license models, unexpanded dependencies, external ZIP
code or unrelated embedded helpers.

```mermaid
flowchart LR
S["Fixed engine and loader source"] --> C["Catalog stamps and candidate admission"]
C --> B["Actual reads / mapping / host staging"]
B --> M["ModelManager completion and owned cleanup"]
C --> R["Owner-local loader/storage reference"]
M --> R
R --> O["Existing residency owner and metadata"]
O --> A["Native registry, readers and two matrices"]
```

## Observations, deductions and execution boundary

Source observation: dependency checks compare path, size and mtime; internal
source/catalog revisions are generations. Metadata parsing and non-ZIP byte
bounds precede actual reads. Regular stream reads and mapping copies can return
failure; host staging/conversion and backend-copy calls are distinct. The
manager's destination callback records a name before bytes are delivered, while
loaded-state publication requires all selected source groups to succeed.
Failure cleanup releases the parameter blocks created for that load. Shared
mapping owners can remain in loader caches or other blocks.

Deduced audit rule: neither a matching stamp nor a successful destination
callback is a byte-identity/completion oracle. Require an independent content
manifest/output oracle when that conclusion matters. Do not infer global
rollback, pinned allocation, physical SSD traffic, cache eviction or device
completion from these interfaces. Loader stage counters divided by the last
file's thread count are not a cold-storage bandwidth denominator.

Native parser/load/failure injection, allocation/unmap behavior, backend-copy
completion, full-model image quality and performance are **not_run**. Matching
GGML/private headers/build and a legal minimal fixture are prerequisites, not
replaceable by mocks or extracted formulas. The source-only readset does not
qualify all GGUF/Torch/ZIP formats, special quantization/conversion correctness,
video/audio or every backend. Agent efficacy is **not evaluated / uncovered**.

## Proposed regression cases

All rows are proposed; no case below is a runtime result. Expected decisions
are stated independently of a source keyword or successful reader invocation.

| Case | Input/condition | Independent expected decision / oracle |
|---|---|---|
| New identity positive | A required shard has changed under the selected index | Refresh/invalidate before reuse; inspect real source and consumer state plus caller result. |
| New identity negative | Same path/size/mtime, different independently recorded digest | Do not certify equal bytes from catalog stamps or generation IDs. Preserve the differing digest. |
| New admission negative | A selected tensor interval exceeds the real file | The real parser/add-file rejects that candidate; its failed admission does not replace the previous accepted catalog. |
| New read negative | A file becomes short after catalog admission | The caller observes failure; callback invocation does not count as load completion. Inspect loaded flags/new-block cleanup without presuming universal rollback. |
| New staging positive | Supported ordinary dtype with the actual read/staging/mapping path selected | Compare real tensor bytes to an independent legal small-fixture oracle. Keep input/target byte counts separate and owners alive through use. |
| New lifetime negative | One block releases its map owners while another owner/cache retains the mapping | Do not predict final unmap or memory savings from one release. Check actual retained owners and final destruction. |
| Old dispatch regression | CPU or multi-device scheduling with a small `max_vram` | Preserve the existing distinction from the non-CPU single-device segmented path; a small budget alone is insufficient dispatch evidence. |
| Old lifetime regression | An active/queued weight becomes unpinned | Preserve the existing distinction between eligibility for reclamation and immediate physical free; async capability alone is not useful overlap. |

If native prerequisites are later supplied, run the real selected parser/manager
for the new cases and the actual backend/model for residency/image claims.
Package/readers validate retained content and access only. Keep preparation,
first image, warm requests, byte equality/quality, host/device peaks and timing
denominators separate; no result in one category promotes the candidate.
Loading
Loading