Skip to content

FC-918 update ledger/db to use try*/catch* macro - #16

Merged
ldw1007 merged 1 commit into
masterfrom
fix/nodejs-ledger-db-exception
Nov 30, 2020
Merged

ldw1007 merged 1 commit into
masterfrom
fix/nodejs-ledger-db-exception

Conversation

@ldw1007

@ldw1007 ldw1007 commented Nov 20, 2020

Copy link
Copy Markdown
Contributor

update ledger/db to use trycatch macro for nodejs (ClojureScript) use

@cap10morgan
cap10morgan requested a review from a team November 20, 2020 19:11

@cap10morgan cap10morgan 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.

👍

@ldw1007
ldw1007 merged commit c41d4d7 into master Nov 30, 2020
@ldw1007
ldw1007 deleted the fix/nodejs-ledger-db-exception branch November 30, 2020 13:12
flyingmachine pushed a commit that referenced this pull request Feb 22, 2023
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.
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.

2 participants