Skip to content

BE-776, BE-777, BE-775: HashQL: Const-evaluable typed IDs, IdMatrix, and fixed-endianness ID byte layouts - #9298

Merged
indietyp merged 3 commits into
mainfrom
bm/be-776-hashql-const-ids
Aug 26, 2026
Merged

BE-776, BE-777, BE-775: HashQL: Const-evaluable typed IDs, IdMatrix, and fixed-endianness ID byte layouts#9298
indietyp merged 3 commits into
mainfrom
bm/be-776-hashql-const-ids

Conversation

@indietyp

@indietyp indietyp commented Aug 24, 2026

Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

HashQL's typed ID system gains three coupled capabilities: const-evaluable ID construction (BE-776), a dense IdMatrix addressed by typed IDs on both axes plus parallel iteration over the ID containers (BE-777), and fixed-endianness byte layouts through zerocopy (BE-775). The consumer driving all three is the atlas (#9305), which stores ID-indexed columns in on-disk artifacts that must read identically across machines, and iterates ID domains large enough for rayon to pay.

These land as one PR because the file topology couples them: core/src/id/slice.rs carries the const constructors, the rayon impls, and the zerocopy derives in one file, and a finer split would invent intermediate file states nobody wrote.

Review focus: the zerocopy derives pin byte layouts that read identically across targets. The second focus is the const support in the ID macros (macros/src/id/), the expansion downstream code relies on.

🔍 What does this change?

  • hashql-core/src/id/: ID construction usable in const contexts, IdMatrix as a dense rectangular matrix addressed by typed IDs on both axes, rayon parallel iterators for the ID containers, and zerocopy-derived byte layouts with fixed endianness.
  • hashql-macros/src/id/: the #[id] attribute gains const support (#[id(display = !, const)]) and emits the layouts above.
  • hashql-mir, hashql-hir, hashql-eval: existing call sites (dominators, Tarjan, data-dependency graph, size estimation) adopt the new container APIs.
  • hash-graph-api: one #[expect(clippy::missing_const_for_fn)] where the lint reports a false positive against the new const machinery.

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?

  • core/src/id/tests.rs covers the containers and layouts.
  • The mir and type-inference suites exercise the adopted call sites.
  • The workspace battery: cargo check, clippy at zero warnings across targets and features, fmt clean, cargo metadata --locked clean.

❓ How to test this?

cargo nextest run -p hashql-core --lib

@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview Aug 26, 2026 12:38pm
petrinaut Ready Ready Preview Aug 26, 2026 12:38pm
petrinaut-docs Ready Ready Preview Aug 26, 2026 12:38pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Aug 26, 2026 12:38pm

Request Review

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.00000% with 69 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.48%. Comparing base (6e2b92d) to head (bf8cb38).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
libs/@local/hashql/core/src/id/matrix.rs 84.25% 19 Missing and 1 partial ⚠️
libs/@local/hashql/core/src/id/vec.rs 54.83% 14 Missing ⚠️
libs/@local/hashql/core/src/id/slice.rs 85.39% 13 Missing ⚠️
libs/@local/hashql/core/src/id/index.rs 0.00% 8 Missing ⚠️
libs/@local/hashql/core/src/id/mod.rs 0.00% 7 Missing ⚠️
...hashql/core/src/graph/algorithms/dominators/mod.rs 0.00% 3 Missing ⚠️
libs/@local/hashql/core/src/id/bit_vec/mod.rs 0.00% 3 Missing ⚠️
libs/@local/hashql/core/src/graph/mod.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9298      +/-   ##
==========================================
+ Coverage   60.45%   60.48%   +0.03%     
==========================================
  Files        1431     1433       +2     
  Lines      141324   141602     +278     
  Branches     6623     6625       +2     
==========================================
+ Hits        85440    85653     +213     
- Misses      54803    54867      +64     
- Partials     1081     1082       +1     
Flag Coverage Δ
apps.hash-ai-worker-ts 1.99% <ø> (ø)
apps.hash-api 14.66% <ø> (ø)
blockprotocol.type-system 40.84% <ø> (ø)
local.claude-hooks 0.00% <ø> (ø)
local.harpc-client 51.49% <ø> (ø)
local.hash-backend-utils 3.27% <ø> (ø)
local.hash-graph-sdk 10.02% <ø> (ø)
local.hash-isomorphic-utils 12.22% <ø> (ø)
rust.antsi 2.36% <ø> (ø)
rust.error-stack 90.81% <ø> (ø)
rust.harpc-codec 84.70% <ø> (ø)
rust.harpc-net 96.19% <ø> (-0.02%) ⬇️
rust.harpc-tower 67.03% <ø> (ø)
rust.harpc-types 0.00% <ø> (ø)
rust.harpc-wire-protocol 92.23% <ø> (ø)
rust.hash-codec 72.76% <ø> (ø)
rust.hash-config 100.00% <ø> (?)
rust.hash-graph-api 17.74% <ø> (ø)
rust.hash-graph-authentication 96.36% <ø> (ø)
rust.hash-graph-authorization 62.59% <ø> (ø)
rust.hash-graph-embeddings 91.88% <ø> (ø)
rust.hash-graph-postgres-store 29.39% <ø> (ø)
rust.hash-graph-store 48.42% <ø> (ø)
rust.hash-graph-temporal-versioning 47.95% <ø> (ø)
rust.hash-graph-types 0.00% <ø> (ø)
rust.hash-graph-validation 84.71% <ø> (ø)
rust.hashql-ast 89.63% <ø> (ø)
rust.hashql-compiletest 28.39% <ø> (ø)
rust.hashql-core 78.95% <75.95%> (-0.03%) ⬇️
rust.hashql-diagnostics 72.51% <ø> (ø)
rust.hashql-eval 79.82% <100.00%> (ø)
rust.hashql-hir 89.09% <100.00%> (ø)
rust.hashql-mir 87.92% <100.00%> (ø)
rust.hashql-syntax-jexpr 94.04% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

@codspeed-hq

codspeed-hq Bot commented Aug 24, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 98 untouched benchmarks


Comparing bm/be-776-hashql-const-ids (bf8cb38) with main (6e2b92d)

Open in CodSpeed

@indietyp indietyp changed the title BE-776: hashql const ids, IdMatrix, zerocopy layouts BE-776, BE-777, BE-775: HashQL: Const-evaluable typed IDs, IdMatrix, and fixed-endianness ID byte layouts Aug 24, 2026
@indietyp indietyp self-assigned this Aug 24, 2026
@indietyp
indietyp force-pushed the bm/be-776-hashql-const-ids branch from 8d0a1e5 to 3f255db Compare August 24, 2026 15:53
@indietyp
indietyp marked this pull request as ready for review August 24, 2026 15:54
@cursor

cursor Bot commented Aug 24, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes macro-generated ID layouts and const/indexing contracts across HashQL; fixed-endian zerocopy encodings are persistence-sensitive, though bounded validation and new tests reduce regression risk.

Overview
Extends HashQL’s typed ID infrastructure so domain-indexed data can be built in const, laid out as dense matrices, scanned in parallel, and serialized with stable byte layouts—primarily for atlas-style on-disk artifacts.

The define_id! / #[id] macros now support const impls, optional unbounded ranges (no is clause), a get() scalar accessor, and unaligned + endian storage that pins IDs as zerocopy byte encodings (bounded IDs use hand-written TryFromBytes so out-of-range bytes are rejected). Id, IntoSliceIndex, and several graph helpers gain const APIs; NodeId / EdgeId use const newtypes.

IdMatrix is a new row-major matrix indexed by two ID types, with rows as IdSlice. IdSlice / IdVec add prefix views, chunk/window iterators (including ID-tagged enumerated forms), sorting/search helpers, into_raw / boxed conversions, optional rayon parallel iterators, and optional zerocopy on IdArray / IdSlice. DenseBitSet::words() exposes raw bit words for word-level readers.

Downstream crates adopt #[id(const)] and const methods in MIR/HIR/eval/graph paths; workspace adds rayon and zerocopy (0.8.55) with matching hashql-core features.

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

Comment thread libs/@local/hashql/core/src/id/slice.rs Outdated
Comment thread libs/@local/hashql/core/src/id/matrix.rs

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3fb52d2. Configure here.

Comment thread libs/@local/hashql/core/src/id/slice.rs
@github-actions

Copy link
Copy Markdown
Contributor

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 $$27.8 \mathrm{ms} \pm 252 \mathrm{μs}\left({\color{gray}-1.713 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.47 \mathrm{ms} \pm 30.6 \mathrm{μs}\left({\color{gray}-2.681 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$12.3 \mathrm{ms} \pm 113 \mathrm{μs}\left({\color{lightgreen}-7.661 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$43.3 \mathrm{ms} \pm 444 \mathrm{μs}\left({\color{gray}-4.458 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$14.2 \mathrm{ms} \pm 158 \mathrm{μs}\left({\color{lightgreen}-11.015 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$23.7 \mathrm{ms} \pm 209 \mathrm{μs}\left({\color{lightgreen}-7.179 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$28.4 \mathrm{ms} \pm 241 \mathrm{μs}\left({\color{gray}-3.017 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.77 \mathrm{ms} \pm 30.1 \mathrm{μs}\left({\color{gray}-3.341 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.4 \mathrm{ms} \pm 123 \mathrm{μs}\left({\color{lightgreen}-6.887 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$4.36 \mathrm{ms} \pm 59.1 \mathrm{μs}\left({\color{red}11.1 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.69 \mathrm{ms} \pm 30.2 \mathrm{μs}\left({\color{red}19.0 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$4.12 \mathrm{ms} \pm 39.9 \mathrm{μs}\left({\color{red}18.7 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$6.18 \mathrm{ms} \pm 80.7 \mathrm{μs}\left({\color{red}16.2 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.91 \mathrm{ms} \pm 42.1 \mathrm{μs}\left({\color{red}8.52 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$4.60 \mathrm{ms} \pm 53.3 \mathrm{μs}\left({\color{red}9.91 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$5.45 \mathrm{ms} \pm 50.8 \mathrm{μs}\left({\color{red}19.7 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$4.29 \mathrm{ms} \pm 35.6 \mathrm{μs}\left({\color{red}20.3 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$5.19 \mathrm{ms} \pm 50.3 \mathrm{μs}\left({\color{red}24.8 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.66 \mathrm{ms} \pm 21.2 \mathrm{μs}\left({\color{gray}-2.346 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.58 \mathrm{ms} \pm 22.0 \mathrm{μs}\left({\color{gray}1.38 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$2.73 \mathrm{ms} \pm 30.4 \mathrm{μs}\left({\color{gray}0.002 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$3.06 \mathrm{ms} \pm 34.8 \mathrm{μs}\left({\color{gray}2.94 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.88 \mathrm{ms} \pm 34.5 \mathrm{μs}\left({\color{gray}4.57 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$3.47 \mathrm{ms} \pm 32.6 \mathrm{μs}\left({\color{red}14.9 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.51 \mathrm{ms} \pm 38.2 \mathrm{μs}\left({\color{red}15.0 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.31 \mathrm{ms} \pm 33.5 \mathrm{μs}\left({\color{red}19.8 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$3.51 \mathrm{ms} \pm 39.9 \mathrm{μs}\left({\color{red}16.7 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.55 \mathrm{ms} \pm 25.5 \mathrm{μs}\left({\color{gray}2.48 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.59 \mathrm{ms} \pm 38.3 \mathrm{μs}\left({\color{red}20.6 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$3.99 \mathrm{ms} \pm 39.0 \mathrm{μs}\left({\color{red}20.5 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.51 \mathrm{ms} \pm 35.0 \mathrm{μs}\left({\color{gray}2.25 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.18 \mathrm{ms} \pm 30.1 \mathrm{μs}\left({\color{red}7.65 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.45 \mathrm{ms} \pm 26.5 \mathrm{μs}\left({\color{gray}1.44 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$42.7 \mathrm{ms} \pm 224 \mathrm{μs}\left({\color{gray}-0.468 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$33.4 \mathrm{ms} \pm 194 \mathrm{μs}\left({\color{gray}-1.327 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$35.8 \mathrm{ms} \pm 214 \mathrm{μs}\left({\color{gray}-1.141 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$35.3 \mathrm{ms} \pm 812 \mathrm{μs}\left({\color{lightgreen}-23.235 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$41.9 \mathrm{ms} \pm 237 \mathrm{μs}\left({\color{gray}0.237 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$50.1 \mathrm{ms} \pm 409 \mathrm{μs}\left({\color{gray}0.027 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$41.0 \mathrm{ms} \pm 329 \mathrm{μs}\left({\color{gray}1.13 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$93.1 \mathrm{ms} \pm 662 \mathrm{μs}\left({\color{red}7.03 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$34.6 \mathrm{ms} \pm 273 \mathrm{μs}\left({\color{lightgreen}-39.315 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$273 \mathrm{ms} \pm 1.06 \mathrm{ms}\left({\color{red}5.02 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$11.0 \mathrm{ms} \pm 73.1 \mathrm{μs}\left({\color{gray}-0.477 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$11.1 \mathrm{ms} \pm 54.7 \mathrm{μs}\left({\color{gray}-1.552 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$11.2 \mathrm{ms} \pm 74.7 \mathrm{μs}\left({\color{gray}0.156 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$11.1 \mathrm{ms} \pm 75.2 \mathrm{μs}\left({\color{gray}-1.012 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$11.1 \mathrm{ms} \pm 69.7 \mathrm{μs}\left({\color{gray}-0.724 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$11.1 \mathrm{ms} \pm 64.1 \mathrm{μs}\left({\color{gray}-0.499 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$11.3 \mathrm{ms} \pm 85.3 \mathrm{μs}\left({\color{gray}0.142 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$11.2 \mathrm{ms} \pm 86.6 \mathrm{μs}\left({\color{gray}-1.843 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$11.2 \mathrm{ms} \pm 75.4 \mathrm{μs}\left({\color{gray}-2.500 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$11.4 \mathrm{ms} \pm 81.6 \mathrm{μs}\left({\color{gray}-1.946 \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 $$11.6 \mathrm{ms} \pm 100 \mathrm{μs}\left({\color{gray}-0.275 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$11.6 \mathrm{ms} \pm 70.2 \mathrm{μs}\left({\color{gray}-2.204 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$11.4 \mathrm{ms} \pm 73.4 \mathrm{μs}\left({\color{gray}-0.933 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$11.5 \mathrm{ms} \pm 78.2 \mathrm{μs}\left({\color{gray}0.177 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$11.5 \mathrm{ms} \pm 72.2 \mathrm{μs}\left({\color{gray}-3.557 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$11.5 \mathrm{ms} \pm 88.3 \mathrm{μs}\left({\color{gray}-0.310 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$11.5 \mathrm{ms} \pm 78.5 \mathrm{μs}\left({\color{gray}-0.427 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$11.7 \mathrm{ms} \pm 111 \mathrm{μs}\left({\color{gray}-2.699 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$11.7 \mathrm{ms} \pm 69.3 \mathrm{μs}\left({\color{gray}-0.702 \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 $$8.58 \mathrm{ms} \pm 51.1 \mathrm{μs}\left({\color{gray}-3.099 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$55.2 \mathrm{ms} \pm 435 \mathrm{μs}\left({\color{lightgreen}-10.446 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$109 \mathrm{ms} \pm 651 \mathrm{μs}\left({\color{gray}-4.023 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$64.0 \mathrm{ms} \pm 435 \mathrm{μs}\left({\color{lightgreen}-7.682 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$73.3 \mathrm{ms} \pm 667 \mathrm{μs}\left({\color{lightgreen}-7.069 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$83.3 \mathrm{ms} \pm 782 \mathrm{μs}\left({\color{gray}-4.280 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$88.1 \mathrm{ms} \pm 585 \mathrm{μs}\left({\color{lightgreen}-5.970 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$42.2 \mathrm{ms} \pm 329 \mathrm{μs}\left({\color{gray}-3.546 \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 $$71.7 \mathrm{ms} \pm 566 \mathrm{μs}\left({\color{gray}-0.790 \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 $$48.6 \mathrm{ms} \pm 515 \mathrm{μs}\left({\color{lightgreen}-5.506 \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 $$58.2 \mathrm{ms} \pm 520 \mathrm{μs}\left({\color{gray}-3.689 \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 $$60.9 \mathrm{ms} \pm 550 \mathrm{μs}\left({\color{gray}-1.934 \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 $$60.9 \mathrm{ms} \pm 517 \mathrm{μs}\left({\color{gray}-2.095 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$124 \mathrm{ms} \pm 828 \mathrm{μs}\left({\color{gray}3.82 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$134 \mathrm{ms} \pm 653 \mathrm{μs}\left({\color{gray}2.09 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$18.2 \mathrm{ms} \pm 150 \mathrm{μs}\left({\color{lightgreen}-10.102 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$535 \mathrm{ms} \pm 1.34 \mathrm{ms}\left({\color{gray}-3.738 \mathrm{\%}}\right) $$ Flame Graph

@indietyp
indietyp added this pull request to the merge queue Aug 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 26, 2026
@indietyp
indietyp added this pull request to the merge queue Aug 26, 2026
Merged via the queue into main with commit 124a442 Aug 26, 2026
214 checks passed
@indietyp
indietyp deleted the bm/be-776-hashql-const-ids branch August 26, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/deps Relates to third-party dependencies (area) 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.

2 participants