Repository navigation
FC-918 update ledger/db to use try*/catch* macro - #16
Merged
Merged
Conversation
flyingmachine
pushed a commit
that referenced
this pull request
Feb 22, 2023
Sync up w/ latest Fluree API changes
aaj3f
added a commit
that referenced
this pull request
Jul 18, 2026
…d crawl wildcard
071cd59f (`?ol a OrderLine ; orderLineKey "1" . ?ol ?p ?o`, the agent "show me
everything about entity X" idiom) full-scanned 120M FACT_ORDER_LINE: the
const-object `orderLineKey "1"` was emitted as a STANDALONE joined key scan while
the crawl wildcard scanned unconstrained. W4-1's pushdown could not engage because
the constant was a separate scan, not a constraint on the wildcard. Fold the
const-object members onto the co-located crawl wildcard as star_constraints, so
W4-1's build_scan_filters pushes the scalar equality as an Iceberg scan filter and
prunes the crawl scan to the matching subject(s). Semantically identical (the
star_constraint is the same existence filter the join was).
REWRITE (ordering fix a): DEFER the fold until AFTER the class-fusion loop.
Attaching star_constraints in the star loop would make is_standalone_wildcard false
→ try_fuse_wildcard_class SKIPS the class prune → the wildcard fans out to ALL
TriplesMaps (worse than the OOM). A class_filter-tolerant finder (is_crawl_wildcard)
re-locates the now-class-fused wildcard and attaches the constraints, so the two
mutations (class prune + constraint fold) compose. Guard: fold only when var_members
is empty AND exactly one co-located crawl wildcard exists AND every const member is
foldable; else standalone (no regression). Defensive standalone re-emit if the
wildcard is gone.
EXECUTION (ship-blocker caught + upheld via lambda-audit-2's second pass): a folded
wildcard has {predicate_var: Some, predicate_filter: None, star_bindings: [],
star_constraints: non-empty}, so has_star_members()==true routed it AWAY from the
wildcard `?p`/`?o` emission loop into the fixed-predicate star machinery — which
emitted a subject-only row (?p/?o UNBOUND) and read only the constraint column/POM
(the production shape would return ZERO triples). A wildcard (predicate_var.is_some())
is now treated as a true wildcard at all three sites — projection (all columns),
filtered_poms (all POMs), and materialize_batch (skips the fixed-star branch) — and
its star_constraints are applied as a SUBJECT-level existence pre-check before the POM
loop (shared helper row_passes_star_constraints, dedup'd from the fixed-star branch).
So a folded wildcard emits every (p,o) for a subject that satisfies the constraint,
and drops a subject that does not — the same existence semantics as the standalone
join it replaced. (My earlier "gate items i/iii/iv sound" claim was WRONG for item
(i): the fixed-star materialize never reaches the wildcard emission.)
- Hermetics: REWRITE plan — w4_1b_const_object_folds_onto_crawl_wildcard_composing_
with_class + is_crawl_wildcard tolerance. EXECUTION —
w4_1b_folded_wildcard_emits_po_rows_under_star_constraint asserts the actual (p,o)
BINDINGS (satisfied → the SAME triples the unfolded wildcard emits: ?p=storeKey∧?o
AND ?p=rdf:type∧?o=Store, per lambda-audit-2; violated → 0 rows). 1286 lib tests
green (fixed-predicate star path — q061/q065 shapes — unchanged).
- Corpus q068 (orderline detail crawl, FROM path): the folded-crawl shape class NO
member covered — const-object edw:lineNumber 1 folded onto `?ol ?p ?o`. Row-count
parity (native == virtual, rows_only) catches the ship-blocker's 0-triples
regression end-to-end (which is why it nearly shipped); its ex:order/product ref
POMs also drive the F-16 parent-lookup telemetry. Oracle blessed at the gate.
W4-1b prunes the FACT_ORDER_LINE crawl scan. Whether the ex:order RefObjectMap
parent-lookup ALSO bounds to the referenced Order (vs. building over the full
FACT_ORDER) is measured live via q068 at the wave-4 gate; if the full parent scan
survives the child prune, F-16 (#16) carries that parent-lookup-bounding follow-up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
update ledger/db to use trycatch macro for nodejs (ClojureScript) use