Skip to content

BE-429: HashQL: Add island dependency graph with data requirement resolution#8501

Merged
indietyp merged 10 commits intomainfrom
bm/be-429-hashql-per-island-entitypath-requirements-and-fetchisland
May 7, 2026
Merged

BE-429: HashQL: Add island dependency graph with data requirement resolution#8501
indietyp merged 10 commits intomainfrom
bm/be-429-hashql-per-island-entitypath-requirements-and-fetchisland

Conversation

@indietyp
Copy link
Copy Markdown
Member

@indietyp indietyp commented Mar 3, 2026

🌟 What is the purpose of this PR?

This PR implements the island dependency graph construction and scheduling system for the HashQL MIR execution engine. It builds a directed graph over computation islands, resolves data requirements between islands, and computes a topological schedule with parallelism levels for execution.

🔗 Related links

  • Related to the island placement and execution planning work

🔍 What does this change?

  • Adds first_set() method to FiniteBitSet - Returns the first set bit using trailing_zeros(), with comprehensive test coverage for empty sets, single bits, multiple bits, and wide integral types
  • Enhances IdVec with new utility methods - Adds from_raw(), from_domain_derive(), extend_from_slice(), append(), into_iter_enumerated(), and copy_within() methods with detailed documentation and examples
  • Implements island dependency graph (IslandGraph) - Creates a directed graph over IslandNodes connected by three edge types: ControlFlow (execution ordering), DataFlow (data dependencies), and Inherits (path inheritance between same-target dominators)
  • Adds data requirement resolution - Automatically inserts synthetic data islands when traversal paths cannot be satisfied by upstream providers, using dominator analysis to find optimal providers
  • Implements island scheduling (IslandSchedule) - Computes topological ordering with parallelism levels using Kahn's algorithm, allowing islands at the same level to execute concurrently
  • Adds comprehensive test suites - Tests cover single islands, data edges between predecessors, fetch island insertion, diamond CFG patterns, inheritance edges, data island reuse, and scheduling correctness
  • Enables option_into_flat_iter feature - Adds the unstable feature flag for iterator functionality

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

🛡 What tests cover this?

  • Unit tests for FiniteBitSet::first_set() covering empty sets, single/multiple bits, edge cases
  • Integration tests for island graph construction with various CFG patterns
  • Tests for data requirement resolution including fetch island insertion and reuse
  • Schedule computation tests verifying topological ordering and parallelism levels
  • Tests for edge deduplication and dominator-based inheritance

❓ How to test this?

  1. Run the test suite with cargo test
  2. Check that island graph construction correctly identifies dependencies
  3. Verify that data islands are inserted when traversal paths cannot be satisfied
  4. Confirm that scheduling produces valid topological ordering with correct parallelism levels

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment May 7, 2026 9:29am
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign Ignored Ignored Preview May 7, 2026 9:29am
hashdotdesign-tokens Ignored Ignored Preview May 7, 2026 9:29am
petrinaut Skipped Skipped May 7, 2026 9:29am

@cursor
Copy link
Copy Markdown

cursor Bot commented Mar 3, 2026

PR Summary

Medium Risk
Introduces new execution-planning logic (dependency graph, dominator-based data resolution, and scheduling) that can change runtime ordering and data-fetch behavior; covered by new targeted tests but touches core MIR execution passes.

Overview
Adds an IslandGraph execution-planning layer that builds a dependency graph over placed islands, dedupes control-flow edges, resolves cross-target data requirements via dominator search, and inserts synthetic Data islands when no upstream provider exists (plus Inherits edges for same-target dominator sharing).

Introduces IslandSchedule to compute a topological order with per-island parallelism levels (Kahn-style), and re-exports the new graph/schedule types from pass::execution.

Extends core utilities used by this planner: FiniteBitSet::first_set() (with tests) and new IdVec APIs (from_raw, domain-derive constructor, enumerated iterator, copy_within, etc.), along with minor traversal/path docs and a tightened island traversal join test expectation.

Reviewed by Cursor Bugbot for commit a7532ed. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown
Member Author

indietyp commented Mar 3, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Mar 3, 2026

🤖 Augment PR Summary

Summary: Adds an island dependency graph and scheduler to the HashQL MIR execution engine, including automatic data requirement resolution across targets.

Changes:

  • Introduces IslandGraph to model ControlFlow, DataFlow, and Inherits dependencies between computation islands
  • Resolves traversal-path data requirements via dominator analysis and inserts synthetic data islands when no upstream provider exists
  • Adds IslandSchedule to compute a levelized topological schedule (parallelism levels) using Kahn’s algorithm
  • Extends core utilities: FiniteBitSet::first_set() and several IdVec helpers (construction, append/extend, enumerated iteration, copy-within)
  • Adds comprehensive test coverage for bitset behavior, island graph construction/resolution scenarios, and schedule level ordering

Technical Notes: Data island selection uses the first set origin target (backend-priority order), and schedule levels are derived from predecessor constraints to enable safe parallel execution.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread libs/@local/hashql/core/src/id/vec.rs
Comment thread libs/@local/hashql/mir/src/pass/execution/island/schedule/mod.rs
Comment thread libs/@local/hashql/mir/src/pass/execution/island/graph/mod.rs Outdated
Comment thread libs/@local/hashql/mir/src/pass/execution/island/graph/mod.rs Outdated
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 3, 2026

Merging this PR will not alter performance

✅ 80 untouched benchmarks


Comparing bm/be-429-hashql-per-island-entitypath-requirements-and-fetchisland (a7532ed) with main (30851c6)

Open in CodSpeed

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 95.29086% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.34%. Comparing base (30851c6) to head (a7532ed).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
.../hashql/mir/src/pass/execution/island/graph/mod.rs 91.60% 19 Missing and 2 partials ⚠️
...ashql/mir/src/pass/execution/island/graph/tests.rs 97.50% 6 Missing and 1 partial ⚠️
...shql/mir/src/pass/execution/island/schedule/mod.rs 88.46% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8501      +/-   ##
==========================================
+ Coverage   62.16%   62.34%   +0.18%     
==========================================
  Files        1345     1349       +4     
  Lines      135662   136384     +722     
  Branches     5732     5750      +18     
==========================================
+ Hits        84332    85030     +698     
- Misses      50426    50447      +21     
- Partials      904      907       +3     
Flag Coverage Δ
apps.hash-ai-worker-ts 1.41% <ø> (ø)
apps.hash-api 0.00% <ø> (ø)
local.hash-backend-utils 0.00% <ø> (ø)
local.hash-graph-sdk 9.63% <ø> (ø)
local.hash-isomorphic-utils 0.00% <ø> (ø)
rust.hash-graph-api 2.52% <ø> (ø)
rust.hashql-ast 87.23% <ø> (ø)
rust.hashql-compiletest 29.63% <ø> (ø)
rust.hashql-core 82.38% <100.00%> (+0.02%) ⬆️
rust.hashql-eval 69.13% <ø> (ø)
rust.hashql-hir 89.06% <ø> (ø)
rust.hashql-mir 92.45% <95.02%> (+0.11%) ⬆️
rust.hashql-syntax-jexpr 94.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread libs/@local/hashql/mir/src/pass/execution/island/graph/tests.rs Fixed
@vercel vercel Bot temporarily deployed to Preview – petrinaut March 8, 2026 16:56 Inactive
@indietyp indietyp force-pushed the bm/be-429-hashql-per-island-entitypath-requirements-and-fetchisland branch from 922e42b to 572197c Compare March 8, 2026 17:03
@indietyp indietyp force-pushed the bm/be-428-hashql-simplify-traversal-tracking-to-path-recording branch from 7014842 to e6439e0 Compare March 8, 2026 17:03
TimDiekmann
TimDiekmann previously approved these changes Mar 12, 2026
@indietyp indietyp force-pushed the bm/be-429-hashql-per-island-entitypath-requirements-and-fetchisland branch from 572197c to 74ce977 Compare March 20, 2026 08:11
thehabbos007
thehabbos007 previously approved these changes May 6, 2026
Copy link
Copy Markdown
Contributor

@thehabbos007 thehabbos007 left a comment

Choose a reason for hiding this comment

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

Looks good to me :)

Base automatically changed from bm/be-428-hashql-simplify-traversal-tracking-to-path-recording to main May 7, 2026 09:19
@github-actions github-actions Bot added the area/tests New or updated tests label May 7, 2026
@indietyp indietyp force-pushed the bm/be-429-hashql-per-island-entitypath-requirements-and-fetchisland branch from 4503abc to a7532ed Compare May 7, 2026 09:20
@vercel vercel Bot temporarily deployed to Preview – petrinaut May 7, 2026 09:20 Inactive
@github-actions github-actions Bot removed the area/tests New or updated tests label May 7, 2026
@github-actions github-actions Bot dismissed thehabbos007’s stale review May 7, 2026 09:21

Latest approval commit 4503abc is not an ancestor of a7532ed, indicating rewritten history after approval

@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app Bot commented May 7, 2026

Merge activity

  • May 7, 9:21 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Benchmark results

@rust/hash-graph-benches – Integrations

policy_resolution_large

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2002 $$26.4 \mathrm{ms} \pm 167 \mathrm{μs}\left({\color{gray}0.358 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.83 \mathrm{ms} \pm 16.7 \mathrm{μs}\left({\color{gray}-2.669 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$11.9 \mathrm{ms} \pm 75.2 \mathrm{μs}\left({\color{gray}2.45 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$37.9 \mathrm{ms} \pm 302 \mathrm{μs}\left({\color{gray}-1.721 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$11.4 \mathrm{ms} \pm 88.5 \mathrm{μs}\left({\color{lightgreen}-7.754 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$20.8 \mathrm{ms} \pm 144 \mathrm{μs}\left({\color{gray}-1.386 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$27.1 \mathrm{ms} \pm 171 \mathrm{μs}\left({\color{gray}-0.495 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.11 \mathrm{ms} \pm 17.3 \mathrm{μs}\left({\color{gray}-2.990 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$12.9 \mathrm{ms} \pm 82.1 \mathrm{μs}\left({\color{gray}1.58 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.15 \mathrm{ms} \pm 20.6 \mathrm{μs}\left({\color{gray}0.454 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.44 \mathrm{ms} \pm 12.2 \mathrm{μs}\left({\color{gray}1.48 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$2.75 \mathrm{ms} \pm 16.5 \mathrm{μs}\left({\color{gray}-0.359 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$4.46 \mathrm{ms} \pm 31.3 \mathrm{μs}\left({\color{gray}2.73 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.92 \mathrm{ms} \pm 14.4 \mathrm{μs}\left({\color{gray}1.52 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$3.45 \mathrm{ms} \pm 20.6 \mathrm{μs}\left({\color{gray}1.79 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$3.73 \mathrm{ms} \pm 23.3 \mathrm{μs}\left({\color{gray}-0.051 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.86 \mathrm{ms} \pm 18.0 \mathrm{μs}\left({\color{gray}1.37 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$3.35 \mathrm{ms} \pm 22.2 \mathrm{μs}\left({\color{gray}0.514 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.08 \mathrm{ms} \pm 11.8 \mathrm{μs}\left({\color{gray}0.390 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.01 \mathrm{ms} \pm 10.8 \mathrm{μs}\left({\color{gray}0.612 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.05 \mathrm{ms} \pm 10.5 \mathrm{μs}\left({\color{gray}-0.288 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.29 \mathrm{ms} \pm 15.7 \mathrm{μs}\left({\color{gray}2.06 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.13 \mathrm{ms} \pm 11.2 \mathrm{μs}\left({\color{gray}1.50 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.25 \mathrm{ms} \pm 11.4 \mathrm{μs}\left({\color{gray}-0.918 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$2.44 \mathrm{ms} \pm 14.0 \mathrm{μs}\left({\color{gray}-0.057 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.21 \mathrm{ms} \pm 12.8 \mathrm{μs}\left({\color{gray}0.881 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$2.38 \mathrm{ms} \pm 14.2 \mathrm{μs}\left({\color{gray}-0.435 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$2.74 \mathrm{ms} \pm 15.5 \mathrm{μs}\left({\color{gray}-0.633 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.38 \mathrm{ms} \pm 13.7 \mathrm{μs}\left({\color{gray}0.166 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$2.64 \mathrm{ms} \pm 15.3 \mathrm{μs}\left({\color{gray}0.480 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$2.68 \mathrm{ms} \pm 14.9 \mathrm{μs}\left({\color{gray}-0.592 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.36 \mathrm{ms} \pm 11.2 \mathrm{μs}\left({\color{gray}0.485 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$2.67 \mathrm{ms} \pm 13.7 \mathrm{μs}\left({\color{gray}0.558 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$47.1 \mathrm{ms} \pm 195 \mathrm{μs}\left({\color{gray}-0.762 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$40.2 \mathrm{ms} \pm 257 \mathrm{μs}\left({\color{gray}1.18 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$44.4 \mathrm{ms} \pm 230 \mathrm{μs}\left({\color{gray}0.868 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$37.4 \mathrm{ms} \pm 172 \mathrm{μs}\left({\color{gray}-2.132 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$55.5 \mathrm{ms} \pm 266 \mathrm{μs}\left({\color{gray}-0.890 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$55.4 \mathrm{ms} \pm 284 \mathrm{μs}\left({\color{gray}1.59 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$48.8 \mathrm{ms} \pm 206 \mathrm{μs}\left({\color{gray}0.147 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$93.9 \mathrm{ms} \pm 402 \mathrm{μs}\left({\color{red}9.12 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$40.1 \mathrm{ms} \pm 199 \mathrm{μs}\left({\color{gray}0.474 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$265 \mathrm{ms} \pm 795 \mathrm{μs}\left({\color{gray}2.73 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$17.2 \mathrm{ms} \pm 92.5 \mathrm{μs}\left({\color{gray}2.12 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$18.2 \mathrm{ms} \pm 78.0 \mathrm{μs}\left({\color{gray}4.56 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$18.3 \mathrm{ms} \pm 95.8 \mathrm{μs}\left({\color{gray}3.58 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$17.3 \mathrm{ms} \pm 108 \mathrm{μs}\left({\color{gray}2.71 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$23.4 \mathrm{ms} \pm 143 \mathrm{μs}\left({\color{red}6.96 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$17.8 \mathrm{ms} \pm 134 \mathrm{μs}\left({\color{red}6.70 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$18.3 \mathrm{ms} \pm 130 \mathrm{μs}\left({\color{red}5.82 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$17.5 \mathrm{ms} \pm 107 \mathrm{μs}\left({\color{gray}-1.539 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$18.8 \mathrm{ms} \pm 111 \mathrm{μs}\left({\color{gray}-0.405 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$25.1 \mathrm{ms} \pm 257 \mathrm{μs}\left({\color{gray}-2.758 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$32.7 \mathrm{ms} \pm 347 \mathrm{μs}\left({\color{gray}-1.420 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$33.4 \mathrm{ms} \pm 348 \mathrm{μs}\left({\color{gray}2.15 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$30.9 \mathrm{ms} \pm 310 \mathrm{μs}\left({\color{lightgreen}-6.611 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$32.3 \mathrm{ms} \pm 301 \mathrm{μs}\left({\color{gray}1.86 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$31.6 \mathrm{ms} \pm 315 \mathrm{μs}\left({\color{gray}-2.500 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$32.0 \mathrm{ms} \pm 319 \mathrm{μs}\left({\color{gray}-2.721 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$32.6 \mathrm{ms} \pm 315 \mathrm{μs}\left({\color{gray}-3.070 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$31.2 \mathrm{ms} \pm 281 \mathrm{μs}\left({\color{gray}-3.485 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$31.7 \mathrm{ms} \pm 325 \mathrm{μs}\left({\color{gray}-3.788 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity_type

Function Value Mean Flame graphs
get_entity_type_by_id Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba $$6.92 \mathrm{ms} \pm 41.4 \mathrm{μs}\left({\color{gray}-2.230 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$93.2 \mathrm{ms} \pm 598 \mathrm{μs}\left({\color{gray}-3.186 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$140 \mathrm{ms} \pm 618 \mathrm{μs}\left({\color{gray}-1.375 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$99.6 \mathrm{ms} \pm 474 \mathrm{μs}\left({\color{gray}-3.447 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$110 \mathrm{ms} \pm 648 \mathrm{μs}\left({\color{gray}-2.488 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$115 \mathrm{ms} \pm 461 \mathrm{μs}\left({\color{gray}-3.601 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$122 \mathrm{ms} \pm 836 \mathrm{μs}\left({\color{gray}-2.634 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$100 \mathrm{ms} \pm 388 \mathrm{μs}\left({\color{gray}-1.413 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$126 \mathrm{ms} \pm 467 \mathrm{μs}\left({\color{gray}-1.221 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$106 \mathrm{ms} \pm 525 \mathrm{μs}\left({\color{gray}-2.068 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$114 \mathrm{ms} \pm 585 \mathrm{μs}\left({\color{gray}-1.402 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$115 \mathrm{ms} \pm 521 \mathrm{μs}\left({\color{gray}-2.319 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$116 \mathrm{ms} \pm 476 \mathrm{μs}\left({\color{gray}-1.580 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$165 \mathrm{ms} \pm 613 \mathrm{μs}\left({\color{gray}1.15 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$163 \mathrm{ms} \pm 1.99 \mathrm{ms}\left({\color{red}18.3 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$35.5 \mathrm{ms} \pm 183 \mathrm{μs}\left({\color{gray}-2.217 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$482 \mathrm{ms} \pm 789 \mathrm{μs}\left({\color{gray}-1.776 \mathrm{\%}}\right) $$ Flame Graph

@indietyp indietyp requested a review from thehabbos007 May 7, 2026 12:50
@indietyp indietyp added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit b922dd2 May 7, 2026
93 checks passed
@indietyp indietyp deleted the bm/be-429-hashql-per-island-entitypath-requirements-and-fetchisland branch May 7, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

4 participants