[FEATURE] Dispatch inherited stream I/O through original native bindings #11
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/posixd#11
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem and motivation
Before this implementation, the mediator received inherited stream SEND endpoints but its authenticated Read/Write/Close dispatcher reached only internal byte channels. Applications cannot use those external descriptors. Native filesystem permission acquisition also needs a real outbound invocation lifetime connected to the original admitted client; descriptive lookup alone cannot provide it.
Proposed behavior and scope
Launchd registers original realm stream receivers before exporting SEND views and serves actual owned CLAIM/COMPLETE/RELINQUISH. Each noncopyable row retains its exact Reply result. Vfsd registers exact endpoints before Powerbox, Launchd and cwd export, preserves legacy users and reserves original delivery storage independently of copied handle metadata. Every allocation family respects that reservation through provider Close and native/receiver settlement. Neither path replays an operation or COMPLETE after refusal. Native route invalidation retains draining custody until acknowledgment; request abandonment preserves an open stream and explicit Close preserves the lender.
Compiler-derived rows account for full protocol packets; Vfsd capacity descriptor version two includes mount, handle and invocation regions. Cleanup scrubs only written packet extents, conservatively retaining the full extent for unknown native output. This is a source cost reduction, not a measured performance result. Eight Launchd, nine Vfsd and four packaging controls are authored but unrun; existing arena controls are updated. The existing native binding workload exercises external writes, Close, exact process exits and lender preservation under unchanged gates.
Inline/component/manual contracts and coherent catalog adoption are updated. Changed code files remain below 1,000 lines (maximum 957); missing_docs enforcement remains and Rust formatting was applied. Tests, builds, lint checks, rustdoc, VM/manual/profiler runs and CI observation remain deferred by user instruction. No execution pass or warning-free build is claimed. The transport defect and stream feature are implemented; native filesystem permission policy, both complete EriX guest-build generations and the external Rust/LLVM guest rebuild remain unfinished.
Phase completion is 16.21% weighted, 4.81% whole-item, with 20/460 parents and 434/894 sub-items complete. Binding cleanup acceptance is restored for completed implementation; waived testing is not a test pass.
Dispatch the existing compatibility Read/Write/Close messages through the original client's live Stream binding after native CLAIM origin and seal checks. Preserve internal channels and their existing behavior. Full descriptor values, including the maximum, remain valid; no new discovery, capability acquisition or implicit default stream is added.
Retain the original inbound serving owner, selected immutable authority row, outbound native caller and exact request/result state across bounded round-robin turns. Query provider status before positive stream I/O so inherited and concurrently shared offsets are never assumed to begin at zero. Exact correlated responses determine actual progress; an offset race can return a no-progress would-block result without automatic replay. Preserve short reads/writes, explicit EOF, direction checks before zero-length success and ordinary already-open descriptor semantics. Mode, UID-zero or ACL descriptions do not widen a stream's native direction.
Use existing counted result storage for bounded write staging and checked read results, and derive all transfer bounds from actual buffer geometry and the shared stream framing. New native-owner state lives in compiled arena records. Do not add a small descriptor or transfer-count ceiling. Client/controller scheduling remains independent while a provider reply or native retirement is pending.
Close the dedicated recipient view through its existing provider-disposal barrier, original caller retirement and independent local SEND absence. Close never closes the lender. A closed binding remains closed, and later client teardown does not repeat its provider effect. On client termination or request abandonment, retire outstanding outbound ownership before forgetting the inbound delivery or disposing its route. Malformed provider/native evidence and uncertain cleanup retain original custody and stop unsafe ordinary work. A lost completion never replays committed I/O.
Authority, security and reliability
Only an original authenticated native client after seal selects its own frozen binding. Numeric descriptors, request IDs, role labels and result bytes confer no native authority. The consumer admits only the exact received endpoint and declared read/write subset, keeps the original provider invocation through RELEASE and accepts no capability transfers. Native caller invalidation, controller disposal and peer failure must not free an owner prematurely or cause fallback to another endpoint.
An inherited stream is already open. Adding a fresh pathname-mode check before each read/write would change its semantics and would not implement filesystem admission. Native filesystem object acquisition, coherent ACL policy and operation-specific effects remain unfinished in the owning permission feature.
Acceptance criteria
Checklist
Implement consumer routing of actual authenticated compatibility Read/Write/Close to the original external stream binding, retaining per-client isolation and existing internal channels.
Implement the consumer's bounded owned provider status/I/O calls, exact framing/correlation/progress checks, partial I/O and explicit EOF without replay or invented offsets.
Complete Close and client/request loss cleanup with original outbound/inbound owners, provider disposal and independent native alias absence; preserve the lender.
Author source-level positive, malformed, rights, mixed-client, partial-progress, cancellation, completion-loss and cleanup controls.
Extend the native binding scenario to exercise actual external descriptor I/O and closure while retaining its original budgets, hard/stall deadlines, exit and inventory gates.
Update inline/component/manual contracts, coherent signed source/catalog selections, linked reviews and the phase completion issue. Tests, builds, lint checks and CI observation remain deferred by instruction; authored tests are not passing evidence.
Connect actual Launchd stream and Vfsd directory owned receiver registration, serving/result custody and exact reply framing; retain original generation reservations through native cleanup.
Alternatives and tradeoffs
Blocking legacy calls would stall unrelated clients and controller cleanup. A global descriptor map or caller-selected endpoint would bypass original custody. Retrying an uncertain write risks duplication. Querying current offsets adds a status round trip but correctly handles inherited shared streams without assuming zero or silently seeking; any later optimization must preserve that contract. The same retained invocation and abandonment rules will support future provider permission acquisition, but this stream implementation does not claim complete filesystem policy enforcement.
Tracking and rollout
Blocking native-stream calls are implemented and signed/published: docs
6357b008, integration6805aad8, lib-posixabifb5ea7e0, posixd7d248ad5, rootd5fcfa912. The independent Integration helper14f8e9f2remains separate from the final catalogs. Publication comprises six signed commits in five repositories, three Cargo selectors and nine catalog selectors, with exact original remote equality and clean feature trees.Typed stream/candidate selection preserves the original description generation before translating an alias into its immutable provider selector. An initial fd may already be closed; its old number never supplies status from a replacement binding. Ordinary stream turns recheck the admitted client, original generation, access and received provider row. Shared modes can clear NONBLOCK without changing access or local inheritance. APPEND is harmless for ordered nonseekable streams. The temporary unsupported-mode refusal is removed with actual implementation.
Only fully correlated native RETRY with zero byte progress and no read flags permits another conditional attempt, after complete retirement of that original provider caller and fresh status. Effect-free status queries may similarly wait after canonical RETRY. Staged write bytes survive every no-progress cycle. OPEN with zero buffered bytes cannot prove EOF or waiting: the actual read may explicitly report EOF while OPEN. Positive short progress finishes immediately; nonblocking EAGAIN remains unchanged. Unknown, malformed, lost or uncertain effects never authorize another attempt. Native caller loss, acknowledged draining, terminal teardown and refused COMPLETE preserve original custody without replay or fabricated EINTR.
Stream admission, wire behavior and state now occupy a dedicated thematic module, separate from common external framing and caller cleanup. Inline rustdoc describes original-generation, no-progress and retirement invariants. Twelve new sealed-service unit controls are authored and unrun, covering zero/EOF, vector waits, source preservation, nonblocking refusal, closed-original aliases, cursor races, malformed retry, peer closure, cancellation, release failure, terminal teardown and completion refusal. The prior mode-refusal control now verifies supported changes preserve identity and access.
The native inherited-stream workload changes mode through an alias, queries the original fd to see the same mode, closes that number after first progress and continues blocking writes through its alias. EAGAIN is not accepted as a blocking result. Original lender, authority, timeout and exit gates remain. Scheduling does not prove a particular wait occurred. Existing cooperative bounded turns remain; no new grant, allocation, deadline, fixed retry count or native protocol family is introduced. Event-driven poll/select remains separate required work; no measured speedup is claimed.
Four of the five concrete I/O implementation substeps are now complete under the testing waiver. Authenticated caught-signal interruption remains unfinished, so complete I/O acceptance stays open. Phase progress is 17.36% weighted and 5.61% whole acceptance: 22/460 parents and 446/907 sub-items, under 160 decomposed parents. Existing parent/section weights are unchanged. Both full EriX guest-build generations and external Rust/LLVM rebuilding inside EriX remain required and unperformed.
Reviews: Posixd, Integration, Rootd, ABI contract, manual.
Coordinate permission enforcement, mediator review, native scenario, manual and phase completion. Existing compatibility and native stream byte encodings remain unchanged. Preserve immutable dependency selectors and original native owner identities. Full EriX and Rust/LLVM guest rebuilds remain required and unproved.
erikinkinen referenced this issue from erix/launchd2026-09-29 11:44:58 +02:00
erikinkinen referenced this issue2026-09-29 11:44:58 +02:00
erikinkinen referenced this issue from erix/docs2026-09-29 11:45:00 +02:00
erikinkinen referenced this issue from erix/integration2026-09-29 11:45:02 +02:00
erikinkinen referenced this issue from erix/vfsd2026-09-29 12:25:29 +02:00