Skip to content

docs(architecture): describe the tree that exists - #1855

Merged
tato123 merged 2 commits into
mainfrom
docs/architecture-describes-the-shipped-tree
Aug 12, 2026
Merged

docs(architecture): describe the tree that exists#1855
tato123 merged 2 commits into
mainfrom
docs/architecture-describes-the-shipped-tree

Conversation

@tato123

@tato123 tato123 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

docs/architecture/ is governed by "current shipped state only — no roadmap, no history of superseded designs" (.claude/rules/docs-policy.md). It had drifted behind three deletions: the plugin ABI and its cdylibs (#1715), the Deno SDK and subprocess-polyglot machinery (#1715), and the schema/manifest layer (#1813 / #1854).

The result was docs instructing a reader to depend on crates, call methods and read example directories that are not in the tree.

10 files, +205 / −254.

Method

One auditor per stale doc, then a second agent per doc whose only job was to refute every "this is gone" verdict. A false dead-verdict deletes documentation that is still correct, which is the expensive error here — so the refuter was told to default to refuting when uncertain.

72 candidate findings → 16 refuted → 56 applied. The 22% refutation rate is the point: those 16 would have been wrong edits. Examples of what the refuters saved — subprocess-rhi-parity.md:174-175, adapter-runtime-integration.md:300-308, texture-registration.md:359-361, ray-tracing-kernel.md:58-62, all of which describe live machinery that merely reads like the deleted model.

What was wrong, by kind

kind example
Crates that do not exist cargo tree -p streamlib-{python,deno}-native — an assertion the reader is told to run, naming two deleted packages. The streamlib-adapter-<name>-helpers convention describes a crate shape the tree has none of.
Methods / constants that do not exist release_for_cross_process documented across 46 lines with Python and Deno call sites and a delegating SDK wrapper — nothing defines it. STREAMLIB_ADAPTER_ABI_VERSION had a section explaining its bump policy; it is nowhere.
Deleted examples cited as canonical four examples/polyglot-*/runner/ references; examples/*/runner matches nothing.
Deno as a first-class target TypeScript samples and "both Python AND Deno together" coverage rules, in a repo where Python is the only authoring runtime.
Paths that moved sdk/streamlib-python/ (now the wheel), ../streamlib-consumer-rhi (lives under runtime/), escalate_request.yaml (the wire is hand-written serde now).
Dead CLAUDE.md# anchors six, four of them in the banner every doc opens with, pointing at an "editing markdown documentation" section CLAUDE.md has never had.

Deletions carry the one-line marker docs-policy.md asks for, naming what went and why. Where a passage was merely wrong rather than dead it was corrected in place, in the doc's own voice.

Verification

  • 0 broken relative links — every ](…) target resolves.
  • Every CLAUDE.md# anchor checked against CLAUDE.md's real headings. #non-negotiables is genuine and survives; the other six are fixed.
  • Every backticked repo path checked for existence. The only remaining non-resolving ones are inside removal markers (correctly naming what was removed) and two in vendored-vulkanalia.md that are relative to the vendored crate root, which the surrounding sentence scopes.
  • The banner is now identical in all 8 docs that carry one. Five never had one; none was added.
gate result
xtask check-no-in-process-placement (scans markdown) pass — 7282 files
xtask check-boundaries pass
ship-change-removed-gate tests 37/37

No code touched — docs/architecture/ only.

Notes for owner

1. Six of thirteen docs needed no content changecompute-kernel, graphics-kernel, ray-tracing-kernel, texture-readback, texture-ring, adapter-timeline-single-writer. They describe RHI/GPU machinery the pivot never touched. This was localized rot, not a rotten directory.

2. One adjacent section left standing, deliberately. adapter-authoring.md's ### Why not add a Vulkan device handle to the producer adapter is rejected-alternative rationale for release_for_cross_process — a method that does not exist. It was outside the verified range so I did not extend the deletion into it. Two questions for you: rationale for a nonexistent API is arguably dead, and docs-policy.md puts "why this over the alternatives" in docs/decisions/ rather than docs/architecture/ anyway. Candidate for relocation or removal.

3. The banner said "Living document. Validate, update, and critique freely." That reads as an invitation to speculate, which is how a doc drifts from shipped state. It now states the constraint instead. If you want the invitation back, it belongs somewhere that is not the doc it licenses editing.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated architecture guides to reflect the current shipped Python runtime and helper-process workflows.
    • Clarified subprocess communication, adapter authoring, backend selection, and GPU resource handling.
    • Removed outdated references to Deno, legacy SDKs, separate libraries, and obsolete configuration paths.
    • Standardized policy links, terminology, examples, diagrams, and current-state guidance across architecture pages.

`docs/architecture/` is governed by "current shipped state only" and had
drifted behind three deletions — the plugin ABI and its cdylibs, the Deno SDK
and the subprocess-polyglot machinery, and the schema/manifest layer. The docs
still instructed a reader to depend on crates, call methods and read example
directories that are not there.

Audited each doc against the tree, one auditor per file, with a second pass
whose job was to refute every "this is gone" verdict — a false one deletes
documentation that is still correct. 72 candidate findings, 16 refuted, 56
applied.

What was wrong, by kind:

- **Crates that do not exist.** `streamlib-python-native` and
  `streamlib-deno-native` appear in `cargo tree -p` assertions a reader is told
  to run; the `streamlib-adapter-<name>-helpers` convention describes a crate
  shape the tree has none of.
- **Methods and constants that do not exist.** `release_for_cross_process` is
  documented across 46 lines with Python and Deno call sites and a delegating
  SDK wrapper; nothing defines it. `STREAMLIB_ADAPTER_ABI_VERSION` has a
  section explaining its bump policy; it is nowhere in the tree.
- **Deleted example directories cited as the canonical implementation.** Four
  `examples/polyglot-*/runner/` references; `examples/*/runner` matches nothing.
- **Deno as a first-class target.** TypeScript code samples and "both Python
  AND Deno together" coverage rules, in a repo where Python is the only
  authoring runtime.
- **Paths that moved.** `sdk/streamlib-python/` (now the wheel),
  `../streamlib-consumer-rhi` (lives under `runtime/`), `escalate_request.yaml`
  (the escalate wire is hand-written serde now).
- **Six dead `CLAUDE.md#` anchors**, four of them in the banner every doc opens
  with — pointing at an "editing markdown documentation" section CLAUDE.md has
  never had. `#non-negotiables` is real and survives.

Deletions carry the one-line marker `docs-policy.md` asks for, naming what went
and why. Where a passage was merely wrong rather than dead it was corrected in
place, in the doc's own voice, rather than removed.

Six of the thirteen docs needed no content change: the RHI, kernel and texture
docs describe machinery the pivot never touched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cf0b0180-a3b3-4402-9574-8b25c8d4f644

📥 Commits

Reviewing files that changed from the base of the PR and between 19b3829 and 4679fce.

📒 Files selected for processing (5)
  • docs/architecture/adapter-authoring.md
  • docs/architecture/adapter-runtime-integration.md
  • docs/architecture/subprocess-rhi-parity.md
  • docs/architecture/texture-ring.md
  • docs/architecture/third-party-gpu-backends.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • docs/architecture/texture-ring.md
  • docs/architecture/third-party-gpu-backends.md
  • docs/architecture/adapter-authoring.md
  • docs/architecture/adapter-runtime-integration.md

📝 Walkthrough

Walkthrough

Architecture documentation now describes the shipped Python-only runtime, consolidated adapter crates, helper-process IPC, current Vulkan integration, and updated texture and backend contracts.

Changes

Architecture documentation alignment

Layer / File(s) Summary
Current-state and policy alignment
docs/architecture/*
Architecture pages now use shipped-state language and current policy and doctrine references.
Consolidated adapter authoring model
docs/architecture/adapter-authoring.md, docs/architecture/surface-adapter.md
The guides now describe single-crate adapters, in-crate helpers, streamlib-free runtime graphs, Python-only examples, and current Vulkan device contracts.
Helper-process runtime and IPC flow
docs/architecture/adapter-runtime-integration.md, docs/architecture/subprocess-rhi-parity.md, docs/architecture/surface-adapter.md, docs/architecture/ray-tracing-kernel.md
The documents now describe Python helper processes, wheel access, UnixStream socketpair IPC, serde wire types, parent-side escalation, and current adapter boundaries.
GPU backend and resource contracts
docs/architecture/texture-registration.md, docs/architecture/third-party-gpu-backends.md
Texture registration and backend guidance now reflects direct registration values, established release paths, and unconditional VulkanComputeBackend construction.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the documentation updates that align architecture pages with the current shipped tree.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/architecture-describes-the-shipped-tree

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/architecture/adapter-authoring.md (1)

93-114: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Apply the one-crate model to all authoring examples.

The checklist now defines an in-crate [[bin]], but later text still names streamlib-adapter-<name>-helpers, starts the Metal walkthrough with three crates, and uses cdylib-side terminology. Replace those references with the shipped helper-process and one-crate model.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/adapter-authoring.md` around lines 93 - 114, Update all
later authoring examples and walkthroughs to consistently use the single
`streamlib-adapter-<name>` crate with its in-crate `[[bin]]` subprocess helper.
Remove references to `streamlib-adapter-<name>-helpers`, revise the Metal
walkthrough from three crates to one crate, and replace cdylib-specific
terminology with the shipped helper-process model while preserving the
dependency-boundary guidance.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/architecture/adapter-runtime-integration.md`:
- Around line 141-144: Update the architecture diagram around the “streamlib
Python surface” and “streamlib._engine” layers so it no longer implies that
streamlib-adapter-skia is a wheel dependency; represent Skia as host-side
composition or list only adapters wired into the subprocess, consistent with
subprocess-rhi-parity.md.
- Around line 3-8: Limit the architecture documentation to shipped state by
removing or relocating roadmap and historical material. In
docs/architecture/adapter-runtime-integration.md lines 3-8, remove the
OpenGL/Skia migration wording; lines 125-132, remove the Deno sample removal
note; and lines 461-466, remove the install_default history note. In
docs/architecture/adapter-authoring.md lines 559-564 and 620-623, delete the
history notes, and at lines 781-784 move or remove the hypothetical Metal
walkthrough. In docs/architecture/texture-ring.md lines 259-261, remove the
VADR-TS-002 reference; in docs/architecture/third-party-gpu-backends.md lines
205-207, move the future engine-tier migration guidance to docs/plan/.

In `@docs/architecture/subprocess-rhi-parity.md`:
- Around line 92-109: Qualify the subsequent consumer-RHI import and
ConsumerVulkanDevice instantiation bullet so it applies only to Vulkan-device
adapters. Preserve the separate streamlib-adapter-opengl behavior, which uses
the EGL DMA-BUF path and does not use ConsumerVulkanTexture,
ConsumerVulkanBuffer, or ConsumerVulkanDevice.
- Around line 215-232: Update the documentation to consistently describe shipped
Python helper-process terminology instead of removed cdylib artifacts: replace
the cdylib labels in docs/architecture/subprocess-rhi-parity.md at lines 204 and
280 (anchor context lines 215-232), “Cdylibs use HostSurfaceRegistration” in
docs/architecture/texture-registration.md at lines 447-450 (site context lines
393-399), and the cdylib anti-pattern in
docs/architecture/third-party-gpu-backends.md at lines 231-236 (site context
line 140). Preserve the surrounding architecture guidance while using the
helper-process terminology at each site.

In `@docs/architecture/texture-registration.md`:
- Around line 30-31: Complete the obsolete CLAUDE.md reference migration: in
docs/architecture/texture-registration.md lines 30-31, link to
.claude/rules/engine-doctrine.md instead; update the remaining CLAUDE.md
reference in docs/architecture/adapter-authoring.md lines 24-25; and replace the
../../CLAUDE.md link in docs/architecture/texture-ring.md lines 259-261 with the
current .claude/rules/ doctrine reference.

---

Outside diff comments:
In `@docs/architecture/adapter-authoring.md`:
- Around line 93-114: Update all later authoring examples and walkthroughs to
consistently use the single `streamlib-adapter-<name>` crate with its in-crate
`[[bin]]` subprocess helper. Remove references to
`streamlib-adapter-<name>-helpers`, revise the Metal walkthrough from three
crates to one crate, and replace cdylib-specific terminology with the shipped
helper-process model while preserving the dependency-boundary guidance.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4e4af327-3d49-42f5-876f-47666d3707c3

📥 Commits

Reviewing files that changed from the base of the PR and between 40b5bb1 and 19b3829.

📒 Files selected for processing (10)
  • docs/architecture/adapter-authoring.md
  • docs/architecture/adapter-runtime-integration.md
  • docs/architecture/adapter-timeline-single-writer.md
  • docs/architecture/ray-tracing-kernel.md
  • docs/architecture/subprocess-rhi-parity.md
  • docs/architecture/surface-adapter.md
  • docs/architecture/texture-registration.md
  • docs/architecture/texture-ring.md
  • docs/architecture/third-party-gpu-backends.md
  • docs/architecture/vendored-vulkanalia.md

Comment thread docs/architecture/adapter-runtime-integration.md
Comment thread docs/architecture/adapter-runtime-integration.md
Comment thread docs/architecture/subprocess-rhi-parity.md
Comment on lines +215 to +232
│ section); its helper-process customers reach it through the
wrapped adapter, and it is not a dep of the wheel.
└───────┼──────────────────────────────────────────────────────────────┘
┌──────────────────────┐ ┌──────────────────────┐
│ PYTHON SUBPROC │ │ DENO SUBPROC
Cargo: consumer-rhi │ │ Cargo: consumer-rhi
+ adapter-{abi, │ │ + adapter-{abi,
vulkan, opengl, │ │ vulkan, opengl,
cpu-readback, │ │ cpu-readback,
cuda}; │ │ cuda};
NOT full streamlib │ │ NOT full streamlib
└──────────────────────┘ └──────────────────────┘
┌──────────────────────┐
│ PYTHON HELPER
Imports the wheel:
consumer-rhi +
surface-client +
adapter-cuda;
import-side Vulkan
only
└──────────────────────┘
```

`cargo tree -p streamlib-{python,deno}-native | grep -c "^streamlib v"`
returns 0 — the capability boundary is enforced by Cargo dep resolution
itself.
`cargo xtask check-boundaries` fails if `streamlib` appears outside
`[dev-dependencies]` in any adapter crate's manifest — the capability
boundary is enforced by Cargo dep resolution itself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Use the shipped Python helper-process terminology consistently.

The current pages still describe removed cdylib artifacts in surrounding sections.

  • docs/architecture/subprocess-rhi-parity.md#L215-L232: replace the cdylib labels at Lines [204] and [280].
  • docs/architecture/texture-registration.md#L393-L399: replace “Cdylibs use HostSurfaceRegistration” at Lines [447-450].
  • docs/architecture/third-party-gpu-backends.md#L140-L140: replace the cdylib anti-pattern at Lines [231-236].
📍 Affects 3 files
  • docs/architecture/subprocess-rhi-parity.md#L215-L232 (this comment)
  • docs/architecture/texture-registration.md#L393-L399
  • docs/architecture/third-party-gpu-backends.md#L140-L140
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/subprocess-rhi-parity.md` around lines 215 - 232, Update
the documentation to consistently describe shipped Python helper-process
terminology instead of removed cdylib artifacts: replace the cdylib labels in
docs/architecture/subprocess-rhi-parity.md at lines 204 and 280 (anchor context
lines 215-232), “Cdylibs use HostSurfaceRegistration” in
docs/architecture/texture-registration.md at lines 447-450 (site context lines
393-399), and the cdylib anti-pattern in
docs/architecture/third-party-gpu-backends.md at lines 231-236 (site context
line 140). Preserve the surrounding architecture guidance while using the
helper-process terminology at each site.

Comment on lines +30 to +31
[CLAUDE.md "Engine-wide defects get fixed at the engine
layer"](../../CLAUDE.md#non-negotiables)) makes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Complete the obsolete CLAUDE.md reference migration.

The current doctrine lives under .claude/rules/, but several changed sections still leave readers on the old root-level document.

  • docs/architecture/texture-registration.md#L30-L31: replace ../../CLAUDE.md#non-negotiables with .claude/rules/engine-doctrine.md.
  • docs/architecture/adapter-authoring.md#L24-L25: update the remaining CLAUDE.md reference at Line [503].
  • docs/architecture/texture-ring.md#L259-L261: replace the remaining ../../CLAUDE.md link at Lines [290-291].
📍 Affects 3 files
  • docs/architecture/texture-registration.md#L30-L31 (this comment)
  • docs/architecture/adapter-authoring.md#L24-L25
  • docs/architecture/texture-ring.md#L259-L261
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/architecture/texture-registration.md` around lines 30 - 31, Complete the
obsolete CLAUDE.md reference migration: in
docs/architecture/texture-registration.md lines 30-31, link to
.claude/rules/engine-doctrine.md instead; update the remaining CLAUDE.md
reference in docs/architecture/adapter-authoring.md lines 24-25; and replace the
../../CLAUDE.md link in docs/architecture/texture-ring.md lines 259-261 with the
current .claude/rules/ doctrine reference.

…hipped design

Three findings from review, all verified against the tree.

- The layered-architecture diagram listed `streamlib-adapter-skia` as
  statically linked into the wheel. The wheel's Cargo.toml does not name it
  and §Distribution says "the wheel's adapter closure excludes skia". The
  diagram also declared every adapter generic over `D: VulkanRhiDevice`,
  which the same PR had just corrected elsewhere.
- `subprocess-rhi-parity.md` contradicted itself after my own edit: one
  bullet said `streamlib-adapter-opengl` is not generic over the device
  flavor, the next said every subprocess instantiates against a consumer
  `VkDevice`. The subprocess bullet is now scoped to the Vulkan-device
  adapters, with opengl's EGL path named.
- Docs policy bans tracker references and proposed work outright. Removed:
  three "will migrate in a separate issue" clauses, a `VADR-TS-002`
  reference, a paragraph promising a same-PR migration of two libraries, and
  the 70-line "Hypothetical walkthrough — Metal on macOS via MoltenVK" whose
  own text calls the adapter "not yet shipped".

The removal markers this PR adds are NOT removed. Review read them as
"history of superseded designs", but `docs-policy.md` mandates them in the
same breath as the ban: "outright deletion is allowed when content is
provably wrong — leave a one-line marker saying what was removed and why."
The rule contradicts itself; following the explicit instruction is the
defensible read, and changing it is a rules change rather than a doc fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tato123

tato123 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Worked all three. Two were real errors of fact, one is a rule that contradicts itself.

Skia in the wheel — valid, fixed. The diagram listed streamlib-adapter-skia under streamlib._engine (the wheel) ← statically linked. sdk/streamlib-python-wheel/Cargo.toml does not name it, and ARCHITECTURE.md:301 says outright that "the wheel's adapter closure excludes skia". The same diagram also declared every adapter generic over D: VulkanRhiDevice, which this PR had already corrected in subprocess-rhi-parity.md — so the diagram was carrying two false claims, not one.

The consumer-RHI bullet — valid, and it was my regression. My edit added "…streamlib-adapter-opengl imports the same host DMA-BUF through EGL rather than a consumer VkDevice, so it is not generic over the device flavor", and left the next bullet asserting that every subprocess imports through ConsumerVulkanTexture and instantiates against a consumer-flavor device. Two adjacent bullets contradicting each other, introduced by this PR. The subprocess bullet is now scoped to the Vulkan-device adapters with opengl's EGL path named.

Roadmap / trackers / unshipped design — valid, fixed. Docs policy bans these outright ("no tracker references, no dates, no roadmap / proposed-work"). Removed: three "will migrate in a separate issue" clauses, the VADR-TS-002 reference, a paragraph promising a same-PR migration of two libraries, and the 70-line "Hypothetical walkthrough — Metal on macOS via MoltenVK" — whose own opening line calls it "an adapter not yet shipped", and which the plan marks post-MVP and undesigned.

The removal markers stay — skipping four of the eight sites. Review read them as "history of superseded designs", which the policy does ban. But the very next bullet of .claude/rules/docs-policy.md mandates them: "Outright deletion is allowed when content is provably wrong — leave a one-line marker saying what was removed and why." The rule bans history in one line and requires this history in the next. Following the explicit instruction is the defensible read, and reconciling the contradiction is a rules change, not a doc fix — it belongs in a .claude/ PR with its own rationale, per flow.md.

Verification: 0 broken relative links, xtask check-no-in-process-placement clean over 7282 files.

@tato123
tato123 merged commit 9008c0c into main Aug 12, 2026
16 checks passed
@tato123
tato123 deleted the docs/architecture-describes-the-shipped-tree branch August 12, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant