Skip to content

Add build/write-prefetch unparse path with coroutine-driven write dispatch - #1732

Open
olabusayoT wants to merge 3 commits into
apache:mainfrom
olabusayoT:daf-3065-prefetch-blind-sweep
Open

olabusayoT wants to merge 3 commits into
apache:mainfrom
olabusayoT:daf-3065-prefetch-blind-sweep

Conversation

@olabusayoT

Copy link
Copy Markdown
Contributor

A build pass runs ahead of a write pass over the same infoset tree, resolving forward references (OVCs) directly against the tree instead of via Suspensions where possible (useBuildWritePrefetch, off by default). Build and write hand off through a two-thread coroutine (BuildCoroutine/WriteCoroutine); write's traversal blocks via UnparseSharedContext.awaitChild wherever build hasn't caught up, and a build-side failure aborts write via a dedicated signal rather than hanging. Suspension.canResolveWithoutWriting is a static heuristic for which OVC expressions can resolve without a real write, used to skip doomed build-side attempts and to fall back to single-pass entirely when none qualify. dfdl:newVariableInstance reads/writes during build resolve against BuildState's own local scope stack rather than the shared vTable's head, with cloneForSuspension correcting a frozen suspension's VariableMap accordingly.

Design Document: https://cwiki.apache.org/confluence/spaces/DAFFODIL/pages/451975094/Build+Write-Prefetch+Unparse+Path

DAFFODIL-3065

…patch

A build pass now runs ahead of a write pass over the same infoset
tree, resolving forward references (OVCs) directly against the tree
instead of via Suspensions where possible (useBuildWritePrefetch, off
by default). Build and write hand off through a two-thread coroutine
(BuildCoroutine/WriteCoroutine); write's traversal blocks via
UnparseSharedContext.awaitChild wherever build hasn't caught up, and a
build-side failure aborts write via a dedicated signal rather than
hanging. Suspension.canResolveWithoutWriting is a static heuristic for
which OVC expressions can resolve without a real write, used to skip
doomed build-side attempts and to fall back to single-pass entirely
when none qualify. dfdl:newVariableInstance reads/writes during build
resolve against BuildState's own local scope stack rather than the
shared vTable's head, with cloneForSuspension correcting a frozen
suspension's VariableMap accordingly.

Design Document: https://cwiki.apache.org/confluence/spaces/DAFFODIL/pages/451975094/Build+Write-Prefetch+Unparse+Path

DAFFODIL-3065
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