Skip to content

BE-585, BE-591: HashQL: Add MIR interpreter test suite and refactor diagnostic categories#8837

Open
indietyp wants to merge 8 commits into
mainfrom
bm/be-585-hashql-split-mir-interpret-diagnostic-api
Open

BE-585, BE-591: HashQL: Add MIR interpreter test suite and refactor diagnostic categories#8837
indietyp wants to merge 8 commits into
mainfrom
bm/be-585-hashql-split-mir-interpret-diagnostic-api

Conversation

@indietyp

@indietyp indietyp commented Jun 8, 2026

Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

This PR wires up the MIR interpreter so it can be exercised end-to-end through the compiletest suite, and restructures the diagnostic category hierarchy so that interpreter errors and bridge (PostgreSQL suspension) errors are unified under a single OrchestratorDiagnosticCategory type rather than being conflated under InterpretDiagnosticCategory.

Previously, bridge errors (query execution failures, row decoding, parameter encoding, etc.) were emitted as InterpretDiagnostic values with a Suspension subcategory bolted onto InterpretDiagnosticCategory. This made it impossible for downstream consumers to distinguish interpreter ICEs from orchestrator bridge failures. The new OrchestratorDiagnosticCategory enum has two variants — Interpret (forwarding interpreter errors) and Bridge (wrapping suspension failures) — giving callers a coherent, single diagnostic type from the orchestration layer.

On the interpreter side, RuntimeError::into_diagnostic is split into into_diagnostic (same category, InterpretDiagnosticCategory) and into_diagnostic_with (maps the category through a caller-supplied closure), enabling the orchestrator to embed interpreter diagnostics inside its own hierarchy without losing information.

A new mir/interpret compiletest suite is added that runs the full pipeline through the MIR interpreter and captures the output, with an initial test demonstrating that field projection through an opaque wrapper is not yet supported.

Additionally, StructBuilder::finish now accepts &InternSet<[Symbol]> directly instead of &Interner, Struct::new_unchecked is marked unsafe with documented safety requirements, all interpreter diagnostic severities are migrated from Severity::Bug/Severity::Error to Critical::BUG/Critical::ERROR, and comprehensive doc-examples are added across the interpreter value types (Dict, List, Struct, Tuple, Opaque, Ptr, Str, Num).

🔍 What does this change?

  • Introduces OrchestratorDiagnosticCategory with Interpret and Bridge variants, replacing the previous use of InterpretDiagnosticCategory::Suspension for bridge errors.
  • Adds BridgeDiagnosticCategory as the subcategory for suspension-fulfillment failures, replacing SuspensionDiagnosticCategory.
  • Removes SuspensionDiagnosticCategory and the Suspension variant from InterpretDiagnosticCategory.
  • Splits RuntimeError::into_diagnostic into into_diagnostic (identity category mapping) and into_diagnostic_with (caller-supplied category mapping), allowing the orchestrator to lift interpreter diagnostics into its own hierarchy.
  • Changes InterpretDiagnostic default severity kind from Severity to Critical, and migrates all diagnostic constructors from Severity::Bug/Severity::Error to Critical::BUG/Critical::ERROR.
  • Makes Struct::new_unchecked unsafe, documenting that callers must ensure fields are sorted; updates all call sites with unsafe blocks and safety comments.
  • Strengthens Struct::new to also reject unsorted field slices.
  • Changes StructBuilder::finish to accept &InternSet<'heap, [Symbol<'heap>]> instead of &Interner, narrowing the dependency.
  • Adds a mir/interpret compiletest suite that runs the interpreter and captures MIR as a secondary output.
  • Adds an initial interpreter test (access-struct-through-opaque) that documents the current limitation of projecting through opaque wrappers.
  • Exposes ReifyDiagnosticCategory, ReifyDiagnostic, and ReifyDiagnosticIssues publicly and adds MirDiagnosticCategory::Reify variant.
  • Adds Opaque::into_value, From<Symbol> for Str, and TryCloneIn for Str.
  • Adds #[inline] annotations and comprehensive doc-examples across interpreter value types.

🛡 What tests cover this?

  • New mir/interpret compiletest suite with access-struct-through-opaque as the first test case, covering the interpreter pipeline end-to-end.
  • Existing StructBuilder unit tests updated to use the new finish signature.
  • Existing interpreter unit tests updated for unsafe Struct::new_unchecked call sites.

❓ How to test this?

  1. Run the compiletest suite targeting mir/interpret.
  2. Confirm the access-struct-through-opaque test produces the expected stderr output showing the interpret::type-invariant diagnostic.
  3. Run the existing MIR interpreter unit tests to confirm no regressions.

indietyp added 5 commits June 8, 2026 11:58
chore: add new dependency

chore: format

feat: error module

feat: introduce hashql_eval interner

chore: checkpoint

feat: checkpoint

feat: checkpoint

chore: remove old value module

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

feat: checkpoint

chore: checkpoint

feat: move entity query into its own modul

fix: query request

feat: checkpoint (it compiles!)

feat: checkpoint

feat: checkpoint

feat: checkpoint

fix: issue around cached thunking

feat: covariance for opaque inners

fix: cfgattr serde

chore: remove graph module
Copilot AI review requested due to automatic review settings June 8, 2026 11:41
@cursor

cursor Bot commented Jun 8, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Diagnostic category and public API changes affect eval orchestration and error reporting paths; struct unsafe and finish signature updates touch runtime value assembly across eval and MIR.

Overview
Adds a mir/interpret compiletest suite that lowers to post-inline MIR, runs the standalone MIR interpreter, and records MIR plus debug-formatted output; the first UI test documents failing field projection through opaque wrappers.

Orchestrator diagnostics are split from interpreter diagnostics: PostgreSQL/bridge failures use OrchestratorDiagnostic / BridgeDiagnosticCategory under OrchestratorDiagnosticCategory (Interpret vs Bridge), removing InterpretDiagnosticCategory::Suspension. Orchestrator::run_in returns OrchestratorDiagnostic and uses RuntimeError::into_diagnostic_with to nest interpreter errors under Interpret.

Interpreter errors default to Critical severities, gain into_diagnostic_with for category lifting, and suspension handling stays in the caller closure. Struct construction tightens: new_unchecked is unsafe (sorted fields), StructBuilder::finish takes &InternSet instead of &Interner, and eval partial hydration call sites follow that API.

Smaller follow-ons: MirDiagnosticCategory::Reify, public reify diagnostic exports, Opaque::into_value / Str cloning helpers, doc examples on value types, and a sorted-field assert in MIR struct reify.

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

@github-actions github-actions Bot added area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/tests New or updated tests labels Jun 8, 2026
@vercel

vercel Bot commented Jun 8, 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, Comment Jun 12, 2026 12:41pm
petrinaut Ready Ready Preview Jun 12, 2026 12:41pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Jun 12, 2026 12:41pm

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.46429% with 87 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.50%. Comparing base (dfe8234) to head (ee4ae89).

Files with missing lines Patch % Lines
libs/@local/hashql/eval/src/orchestrator/error.rs 0.00% 56 Missing ⚠️
libs/@local/hashql/mir/src/interpret/error.rs 90.00% 10 Missing ⚠️
libs/@local/hashql/mir/src/interpret/value/str.rs 50.00% 10 Missing ⚠️
libs/@local/hashql/eval/src/orchestrator/mod.rs 33.33% 4 Missing ⚠️
...bs/@local/hashql/mir/src/interpret/value/struct.rs 96.82% 4 Missing ⚠️
...ibs/@local/hashql/eval/src/orchestrator/partial.rs 88.88% 1 Missing ⚠️
libs/@local/hashql/mir/src/error.rs 0.00% 1 Missing ⚠️
...ibs/@local/hashql/mir/src/interpret/value/tuple.rs 97.77% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8837      +/-   ##
==========================================
+ Coverage   59.17%   59.50%   +0.33%     
==========================================
  Files        1346     1347       +1     
  Lines      130008   130804     +796     
  Branches     5879     5879              
==========================================
+ Hits        76928    77838     +910     
+ Misses      52176    52063     -113     
+ Partials      904      903       -1     
Flag Coverage Δ
rust.hash-graph-api 2.52% <ø> (-0.01%) ⬇️
rust.hashql-compiletest 28.24% <ø> (-0.02%) ⬇️
rust.hashql-eval 75.20% <14.08%> (-0.49%) ⬇️
rust.hashql-mir 88.45% <94.68%> (+1.39%) ⬆️

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.

Copilot AI 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.

Pull request overview

This PR wires the MIR interpreter into the compiletest harness for end-to-end execution tests, and refactors diagnostic category/severity plumbing so orchestration-layer (“bridge”) errors are no longer conflated with interpreter diagnostics. It also tightens/clarifies interpreter value invariants (notably struct field ordering), adds an initial mir/interpret UI test, and expands docs/examples across interpreter value types.

Changes:

  • Add a new mir/interpret compiletest suite that runs MIR through the interpreter and emits MIR as a secondary .mir output.
  • Introduce an orchestrator-level diagnostic category (OrchestratorDiagnosticCategory) that cleanly distinguishes interpreter errors from bridge (PostgreSQL suspension) failures.
  • Harden interpreter value APIs (e.g., Struct::new_unchecked becomes unsafe, Struct::new rejects unsorted fields; StructBuilder::finish takes &InternSet<[Symbol]>) and expand doc-examples/inline hints.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
libs/@local/hashql/mir/tests/ui/interpret/access-struct-through-opaque.stderr Expected stderr for the first MIR interpreter UI test.
libs/@local/hashql/mir/tests/ui/interpret/access-struct-through-opaque.jsonc New UI test case exercising interpreter end-to-end behavior.
libs/@local/hashql/mir/tests/ui/interpret/access-struct-through-opaque.aux.mir Secondary output snapshot of MIR for the UI test.
libs/@local/hashql/mir/tests/ui/interpret/.spec.toml Declares the new mir/interpret compiletest suite.
libs/@local/hashql/mir/src/reify/mod.rs Re-exports reify diagnostics publicly from the MIR crate.
libs/@local/hashql/mir/src/reify/error.rs Makes ReifyDiagnostic* type aliases public.
libs/@local/hashql/mir/src/interpret/value/tuple.rs Adds doc-examples and small API/inline tweaks for tuples.
libs/@local/hashql/mir/src/interpret/value/struct.rs Marks Struct::new_unchecked as unsafe, enforces sorted fields, refactors StructBuilder::finish signature, adds docs/examples.
libs/@local/hashql/mir/src/interpret/value/str.rs Adds From<Symbol> + TryCloneIn for Str and improves docs.
libs/@local/hashql/mir/src/interpret/value/ptr.rs Adds docs/examples and inline hints for function pointers.
libs/@local/hashql/mir/src/interpret/value/opaque.rs Adds Opaque::into_value and expands docs/examples.
libs/@local/hashql/mir/src/interpret/value/num.rs Expands docs/examples for total-order Num.
libs/@local/hashql/mir/src/interpret/value/mod.rs Adds/updates docs and examples for Value operations (type name, subscript, projection).
libs/@local/hashql/mir/src/interpret/value/list.rs Adds docs/examples for list behavior including negative indexing.
libs/@local/hashql/mir/src/interpret/value/dict.rs Adds docs/examples for ordered dict behavior.
libs/@local/hashql/mir/src/interpret/tests.rs Updates tests for unsafe struct construction and related safety comments.
libs/@local/hashql/mir/src/interpret/suspension/temporal.rs Small inline annotations for timestamp conversions.
libs/@local/hashql/mir/src/interpret/runtime.rs Minor inline change; runtime error-to-diagnostic wiring relies on updated severity/category APIs.
libs/@local/hashql/mir/src/interpret/locals.rs Updates struct construction call site for unsafe Struct::new_unchecked with safety justification.
libs/@local/hashql/mir/src/interpret/inputs.rs Adds inline on Default impl for inputs.
libs/@local/hashql/mir/src/interpret/error.rs Refactors interpreter diagnostics: removes suspension category from interpreter, switches default severity kind to Critical, adds category-lifting APIs.
libs/@local/hashql/mir/src/error.rs Adds a MIR diagnostic category variant for reify diagnostics.
libs/@local/hashql/eval/tests/orchestrator/execution.rs Adjusts error conversion for orchestrator diagnostics.
libs/@local/hashql/eval/src/orchestrator/partial.rs Updates call sites for StructBuilder::finish(&interner.symbols, ...).
libs/@local/hashql/eval/src/orchestrator/mod.rs Updates public API to return OrchestratorDiagnostic and uses category-lifting from interpreter errors.
libs/@local/hashql/eval/src/orchestrator/error.rs Introduces OrchestratorDiagnosticCategory with Interpret/Bridge variants and migrates bridge diagnostics to Critical.
libs/@local/hashql/compiletest/src/suite/mod.rs Registers the new mir/interpret suite.
libs/@local/hashql/compiletest/src/suite/mir_interpret.rs Implements the new mir/interpret suite runner.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/@local/hashql/compiletest/src/suite/mir_interpret.rs
Comment thread libs/@local/hashql/mir/src/interpret/error.rs
Comment thread libs/@local/hashql/eval/src/orchestrator/error.rs
Comment thread libs/@local/hashql/eval/src/orchestrator/mod.rs
Comment thread libs/@local/hashql/mir/src/interpret/tests.rs
@codspeed-hq

codspeed-hq Bot commented Jun 8, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 24 untouched benchmarks
⏩ 56 skipped benchmarks1


Comparing bm/be-585-hashql-split-mir-interpret-diagnostic-api (ee4ae89) with main (dfe8234)

Open in CodSpeed

Footnotes

  1. 56 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@vercel vercel Bot temporarily deployed to Preview – petrinaut June 8, 2026 11:55 Inactive
Copilot AI review requested due to automatic review settings June 8, 2026 12:22
@vercel vercel Bot temporarily deployed to Preview – petrinaut June 8, 2026 12:22 Inactive

Copilot AI 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.

Pull request overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.

Comment thread libs/@local/hashql/mir/src/interpret/locals.rs
@vercel vercel Bot temporarily deployed to Preview – petrinaut June 8, 2026 13:05 Inactive
Copilot AI review requested due to automatic review settings June 9, 2026 07:17
@indietyp indietyp force-pushed the bm/be-583-hashql-diagnostics-docs-and-span-improvements branch from a58069f to e6657ac Compare June 9, 2026 07:17
@indietyp indietyp force-pushed the bm/be-585-hashql-split-mir-interpret-diagnostic-api branch from 9ab066d to 5bd5e93 Compare June 9, 2026 07:17

Copilot AI 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.

Pull request overview

Copilot reviewed 29 out of 29 changed files in this pull request and generated no new comments.

@indietyp indietyp force-pushed the bm/be-583-hashql-diagnostics-docs-and-span-improvements branch from e6657ac to d854dc5 Compare June 12, 2026 11:08
@indietyp indietyp force-pushed the bm/be-585-hashql-split-mir-interpret-diagnostic-api branch from 5bd5e93 to 15491ac Compare June 12, 2026 11:08
Base automatically changed from bm/be-583-hashql-diagnostics-docs-and-span-improvements to main June 12, 2026 11:47
@indietyp indietyp force-pushed the bm/be-585-hashql-split-mir-interpret-diagnostic-api branch from 15491ac to ee4ae89 Compare June 12, 2026 12:33
@indietyp indietyp requested a review from a team June 12, 2026 12:34
@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 $$25.9 \mathrm{ms} \pm 214 \mathrm{μs}\left({\color{gray}0.518 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.41 \mathrm{ms} \pm 21.1 \mathrm{μs}\left({\color{gray}-2.495 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$12.5 \mathrm{ms} \pm 125 \mathrm{μs}\left({\color{gray}0.481 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$42.4 \mathrm{ms} \pm 343 \mathrm{μs}\left({\color{gray}-1.336 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$14.4 \mathrm{ms} \pm 123 \mathrm{μs}\left({\color{gray}-4.941 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$24.1 \mathrm{ms} \pm 163 \mathrm{μs}\left({\color{gray}-2.413 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$26.8 \mathrm{ms} \pm 159 \mathrm{μs}\left({\color{gray}1.73 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.67 \mathrm{ms} \pm 16.6 \mathrm{μs}\left({\color{gray}-4.191 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.4 \mathrm{ms} \pm 99.9 \mathrm{μs}\left({\color{gray}1.65 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.75 \mathrm{ms} \pm 26.0 \mathrm{μs}\left({\color{gray}1.69 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.99 \mathrm{ms} \pm 15.7 \mathrm{μs}\left({\color{gray}-0.447 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$3.32 \mathrm{ms} \pm 19.5 \mathrm{μs}\left({\color{gray}0.266 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.11 \mathrm{ms} \pm 33.8 \mathrm{μs}\left({\color{gray}-0.066 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.50 \mathrm{ms} \pm 18.8 \mathrm{μs}\left({\color{gray}-1.373 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$4.06 \mathrm{ms} \pm 26.8 \mathrm{μs}\left({\color{gray}0.085 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.29 \mathrm{ms} \pm 32.1 \mathrm{μs}\left({\color{gray}-0.504 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.42 \mathrm{ms} \pm 16.7 \mathrm{μs}\left({\color{gray}-2.220 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.01 \mathrm{ms} \pm 23.5 \mathrm{μs}\left({\color{gray}-0.832 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.58 \mathrm{ms} \pm 17.9 \mathrm{μs}\left({\color{gray}-2.719 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.49 \mathrm{ms} \pm 12.1 \mathrm{μs}\left({\color{gray}-1.433 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.57 \mathrm{ms} \pm 14.8 \mathrm{μs}\left({\color{gray}-4.251 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.84 \mathrm{ms} \pm 15.4 \mathrm{μs}\left({\color{gray}-3.026 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.63 \mathrm{ms} \pm 15.8 \mathrm{μs}\left({\color{gray}-3.795 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.84 \mathrm{ms} \pm 16.5 \mathrm{μs}\left({\color{gray}-2.303 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$2.99 \mathrm{ms} \pm 14.6 \mathrm{μs}\left({\color{gray}0.729 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.75 \mathrm{ms} \pm 19.4 \mathrm{μs}\left({\color{gray}0.243 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$2.92 \mathrm{ms} \pm 13.0 \mathrm{μs}\left({\color{gray}-1.413 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.37 \mathrm{ms} \pm 21.3 \mathrm{μs}\left({\color{gray}0.197 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.98 \mathrm{ms} \pm 13.8 \mathrm{μs}\left({\color{gray}1.57 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$3.28 \mathrm{ms} \pm 18.5 \mathrm{μs}\left({\color{gray}1.27 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.27 \mathrm{ms} \pm 15.2 \mathrm{μs}\left({\color{gray}-1.108 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.96 \mathrm{ms} \pm 13.5 \mathrm{μs}\left({\color{gray}1.16 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.32 \mathrm{ms} \pm 27.4 \mathrm{μs}\left({\color{gray}1.50 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$54.9 \mathrm{ms} \pm 349 \mathrm{μs}\left({\color{gray}0.225 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$46.5 \mathrm{ms} \pm 201 \mathrm{μs}\left({\color{gray}-0.320 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$49.8 \mathrm{ms} \pm 261 \mathrm{μs}\left({\color{gray}-3.965 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$44.3 \mathrm{ms} \pm 227 \mathrm{μs}\left({\color{gray}-0.968 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$64.0 \mathrm{ms} \pm 330 \mathrm{μs}\left({\color{gray}2.71 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$62.3 \mathrm{ms} \pm 370 \mathrm{μs}\left({\color{gray}2.56 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$55.7 \mathrm{ms} \pm 307 \mathrm{μs}\left({\color{gray}0.317 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$103 \mathrm{ms} \pm 477 \mathrm{μs}\left({\color{gray}-0.866 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$47.9 \mathrm{ms} \pm 200 \mathrm{μs}\left({\color{gray}3.00 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$289 \mathrm{ms} \pm 873 \mathrm{μs}\left({\color{red}5.84 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$19.5 \mathrm{ms} \pm 110 \mathrm{μs}\left({\color{gray}3.06 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$20.3 \mathrm{ms} \pm 115 \mathrm{μs}\left({\color{gray}-0.116 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$20.3 \mathrm{ms} \pm 108 \mathrm{μs}\left({\color{gray}-0.062 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$19.5 \mathrm{ms} \pm 107 \mathrm{μs}\left({\color{gray}1.66 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$25.5 \mathrm{ms} \pm 119 \mathrm{μs}\left({\color{gray}-0.188 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$19.5 \mathrm{ms} \pm 145 \mathrm{μs}\left({\color{gray}1.25 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$19.5 \mathrm{ms} \pm 108 \mathrm{μs}\left({\color{gray}1.48 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$19.5 \mathrm{ms} \pm 105 \mathrm{μs}\left({\color{gray}0.606 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$20.3 \mathrm{ms} \pm 125 \mathrm{μs}\left({\color{gray}0.622 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$27.4 \mathrm{ms} \pm 231 \mathrm{μs}\left({\color{gray}4.59 \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 $$34.9 \mathrm{ms} \pm 302 \mathrm{μs}\left({\color{gray}3.20 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$36.1 \mathrm{ms} \pm 364 \mathrm{μs}\left({\color{red}6.37 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$34.8 \mathrm{ms} \pm 291 \mathrm{μs}\left({\color{gray}3.60 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$35.8 \mathrm{ms} \pm 286 \mathrm{μs}\left({\color{gray}4.34 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$33.9 \mathrm{ms} \pm 294 \mathrm{μs}\left({\color{gray}-1.148 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$35.0 \mathrm{ms} \pm 267 \mathrm{μs}\left({\color{gray}2.39 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$34.1 \mathrm{ms} \pm 301 \mathrm{μs}\left({\color{gray}-0.602 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$34.5 \mathrm{ms} \pm 271 \mathrm{μs}\left({\color{gray}-0.787 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$35.0 \mathrm{ms} \pm 279 \mathrm{μs}\left({\color{gray}3.73 \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.49 \mathrm{ms} \pm 47.3 \mathrm{μs}\left({\color{gray}1.02 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$92.0 \mathrm{ms} \pm 540 \mathrm{μs}\left({\color{gray}1.70 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$147 \mathrm{ms} \pm 574 \mathrm{μs}\left({\color{gray}1.13 \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.8 \mathrm{ms} \pm 502 \mathrm{μs}\left({\color{gray}1.75 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$111 \mathrm{ms} \pm 689 \mathrm{μs}\left({\color{gray}1.90 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$117 \mathrm{ms} \pm 516 \mathrm{μs}\left({\color{gray}0.475 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$125 \mathrm{ms} \pm 615 \mathrm{μs}\left({\color{gray}0.091 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$102 \mathrm{ms} \pm 559 \mathrm{μs}\left({\color{gray}-1.011 \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 $$133 \mathrm{ms} \pm 671 \mathrm{μs}\left({\color{gray}0.706 \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 $$109 \mathrm{ms} \pm 589 \mathrm{μs}\left({\color{gray}-1.418 \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 $$119 \mathrm{ms} \pm 615 \mathrm{μs}\left({\color{gray}-0.060 \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 $$120 \mathrm{ms} \pm 640 \mathrm{μs}\left({\color{gray}-1.007 \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 $$120 \mathrm{ms} \pm 500 \mathrm{μs}\left({\color{gray}-0.582 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$145 \mathrm{ms} \pm 2.08 \mathrm{ms}\left({\color{red}5.02 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$150 \mathrm{ms} \pm 641 \mathrm{μs}\left({\color{gray}-0.220 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$40.4 \mathrm{ms} \pm 252 \mathrm{μs}\left({\color{gray}0.129 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$545 \mathrm{ms} \pm 1.28 \mathrm{ms}\left({\color{gray}-2.395 \mathrm{\%}}\right) $$ Flame Graph

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) area/tests New or updated tests type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

2 participants