Skip to content

SRE-1033: Declare task dependencies where they hold instead of at the root - #9555

Merged
TimDiekmann merged 2 commits into
mainfrom
t/sre-1033-declare-turbo-task-dependencies-where-they-hold-instead-of
Sep 7, 2026
Merged

SRE-1033: Declare task dependencies where they hold instead of at the root#9555
TimDiekmann merged 2 commits into
mainfrom
t/sre-1033-declare-turbo-task-dependencies-where-they-hold-instead-of

Conversation

@TimDiekmann

@TimDiekmann TimDiekmann commented Sep 6, 2026

Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

The root turbo.json chains codegen → ^build, build → codegen and test:unit → codegen, ^build for every package — whether or not the package has a codegen, imports anything from dist, or is a Rust crate. Every task therefore waits for every dependency's build, phantoms reach real tasks two hops away (a tsc --build of @local/status before generating the Graph's OpenAPI spec), and the linter's own build sits ahead of unrelated builds.

This declares each edge where it holds. The checked-in task dependencies show the effect package by package.

🔗 Related links

  • SRE-1033
  • SRE-989 — the build-free carrier this builds on
  • SRE-1034 — the document format this is stacked on
  • SRE-984 — the Cargo-workspace move both clear the way for

🔍 What does this change?

  • Task names shared between the JavaScript packages and the Rust crates (codegen, build, dev, start:*, test:*) carry no edges at the root. Each package declares what its tasks consume: a codegen that loads its config from a dependency's dist names that build, a build that compiles against dist depends on ^build, a start names the service it waits for.
  • Names a single toolchain uses keep root defaults. lint:tsc, lint:eslint and fix:eslint depend on ^build, since type-aware linting resolves workspace imports from dist. lint:clippy, the benches, codspeed and miri depend on ^manifest.
  • test:unit and test:integration keep a root default of ^manifest: a test reads its dependencies' sources through its toolchain, so their inputs belong in its hash whether or not a build runs first. Packages that import from dist add ^build themselves.
  • Edges the recursion supplied by accident and that are true are now explicit — petrinaut-opt's codegen reads the models petrinaut-python generates; the frontend's codegen loads its GraphQL config and both Panda presets from dist; dev and start wait for what they serve. Explicit edges stay where ^build does not reach them, such as the brunch plugins that are not dependencies of the agent.
  • hash-api declares a build that runs nothing of its own and gathers its codegen and its dependencies' builds. Its image runs turbo build --filter '@apps/hash-api', and the integration tests import the package, so both now also get @local/hash-backend-utils#build, which the recursion had never included.
  • hash-graph keeps its start:* chain in its own turbo.json; the health-check edges of the Rust test packages move from the root default into tests/graph/benches and tests/graph/http.

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:

  • affected the execution graph, and the turbo.json's have been updated to reflect this

⚠️ Known issues

The oxlint packages inherit the lint:eslint default, including @local/eslint#build, which they do not use. SRE-1018 decides how those tasks are named; this PR leaves them as they are.

🐾 Next steps

@rust/hash-status depends on the TypeScript @local/status, the leftover that put a tsc --build in front of Rust tasks. It deserves a change of its own.

🛡 What tests cover this?

The checked-in task dependencies are regenerated in CI and diffed; the 30 changed documents are part of this PR. Verified by measurement against the SRE-1034 tip: the set of executable tasks is unchanged; every predecessor a task no longer executes is one it never read, and every predecessor it gains is one it imports or waits for; the closure over the documents equals turbo's execution plan for thirteen sampled tasks across apps, libraries, the integration tests and the Rust test packages; the four service images plan the same tasks as before except for the added hash-backend-utils build; a change in error-stack-macros still moves @rust/error-stack#test:unit's hash through ^manifest; a change in @local/hash-isomorphic-utils still selects codegen, test:unit and lint:tsc of hash-api and hash-frontend through the named edges.

❓ How to test this?

  1. Check out the branch
  2. Run turbo run test:unit --filter @local/hash-graph-sdk --dry=json and compare the planned tasks with libs/@local/graph/sdk/typescript/docs/task-dependencies.json
  3. Change a file in libs/@local/hash-isomorphic-utils/src and run turbo query 'query { affectedTasks(base: "HEAD") { items { fullName } } }'; @apps/hash-api#codegen is listed
  4. Run turbo run codegen --filter @apps/hash-frontend --dry=json; the plan contains the three named builds and nothing else
  5. Run turbo build --filter @apps/hash-api --dry=json; the plan is hash-api's codegen plus its dependencies' builds

@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
hash Ready Ready Preview Sep 7, 2026 10:19am UTC
petrinaut Ready Ready Preview Sep 7, 2026 10:19am UTC
petrinaut-docs Ready Ready Preview Sep 7, 2026 10:19am UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Sep 7, 2026 10:19am UTC

Request Review

@TimDiekmann TimDiekmann self-assigned this Sep 6, 2026
@github-actions github-actions Bot added area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team type/eng > backend Owned by the @backend team area/tests New or updated tests area/tests > integration New or updated integration tests area/tests > playwright New or updated Playwright tests area/apps area/apps > hash-graph area/apps > hash.design Affects the `hash.design` design site (app) labels Sep 6, 2026
@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.93%. Comparing base (50327ec) to head (9d76d36).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9555   +/-   ##
=======================================
  Coverage   65.93%   65.93%           
=======================================
  Files        1884     1884           
  Lines      198146   198146           
  Branches     8230     8230           
=======================================
+ Hits       130643   130644    +1     
  Misses      65973    65973           
+ Partials     1530     1529    -1     
Flag Coverage Δ
rust.hash-graph-atlas 80.33% <ø> (+<0.01%) ⬆️

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 Sep 6, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 15.93%

⚠️ 6 benchmarks measured no execution time

Nothing ran under measurement, usually because the compiler removed the code under test. These results are not comparable, so they count as unchanged.

Preventing compiler optimizations

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 2 regressed benchmarks
✅ 96 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
bit_matrix/dense/iter_row[64] 137.2 ns 166.4 ns -17.53%
bit_matrix/dense/iter_row[200] 174.7 ns 203.9 ns -14.31%
⚠️ as_constant < 1 ns < 1 ns N/A
⚠️ constant_equal < 1 ns < 1 ns N/A
⚠️ constant_not_equal < 1 ns < 1 ns N/A
⚠️ access < 1 ns < 1 ns N/A
⚠️ runtime_equal < 1 ns < 1 ns N/A
⚠️ runtime_not_equal < 1 ns < 1 ns N/A

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing t/sre-1033-declare-turbo-task-dependencies-where-they-hold-instead-of (9d76d36) with main (50327ec)

Open in CodSpeed

@TimDiekmann
TimDiekmann marked this pull request as ready for review September 7, 2026 08:49
@TimDiekmann
TimDiekmann requested a review from a team as a code owner September 7, 2026 08:49
Copilot AI balanced review requested due to automatic review settings September 7, 2026 08:49
@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes CI/local Turbo execution order and caching for the whole monorepo; incorrect edges could skip required builds or codegen, though regenerated task-dependency docs and PR verification aim to keep plans equivalent aside from documented fixes.

Overview
Moves Turborepo task edges off the root turbo.json and onto each package, so tasks only wait on builds, codegen, or service healthchecks they actually use.

The root no longer chains codegen → ^build, build → codegen, dev → codegen, or global start:* / test:* build prerequisites. Shared JS/Rust task names (codegen, build, dev, start:*, test:*) default to empty at the root; test:unit / test:integration default to ^manifest so cache keys still track dependency sources without forcing every transitive dist build. Type-aware lint:eslint / lint:tsc / fix:eslint now depend on ^build at the root; lint:types depends on codegen for Python.

Per-app and per-lib turbo.json files add the real edges: e.g. codegen that reads dist (hash-api, hash-frontend, plugin-browser), build:docker → ^manifest, start → peer healthchecks, hash-api#build as codegen + ^build, hash-graph owning its start:* chain, and Rust integration benches/http wiring graph healthchecks locally. docs/task-dependencies.json across ~30 packages is regenerated to match.

Net effect: fewer phantom tasks (like building @local/eslint or @local/status ahead of unrelated work), plus one intentional fix—hash-api build/integration paths now include @local/hash-backend-utils#build where recursion had skipped it.

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

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.

🟡 Changes recommended

Package-level overrides currently discard root cache, persistence, and environment settings for multiple tasks.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Moves Turborepo dependency edges from global defaults to the packages that consume them, reducing unnecessary cross-workspace builds.

Changes:

  • Replaces broad root dependencies with package-specific task edges.
  • Adds explicit build, codegen, test, development, and service dependencies.
  • Regenerates task-dependency snapshots.
File summaries
File Description
turbo.json Redefines root task defaults.
tests/hash-playwright/turbo.json Adds targeted codegen and lint dependencies.
tests/hash-playwright/docs/task-dependencies.json Updates generated task graph.
tests/hash-backend-integration/turbo.json Localizes codegen and integration-test edges.
tests/hash-backend-integration/docs/task-dependencies.json Updates generated task graph.
tests/graph/integration/turbo.json Uses manifest dependency hashing.
tests/graph/integration/docs/task-dependencies.json Updates generated task graph.
tests/graph/http/turbo.json Adds Graph health-check dependency.
tests/graph/http/docs/task-dependencies.json Updates generated task graph.
tests/graph/benches/turbo.json Adds benchmark and test service dependencies.
tests/graph/benches/docs/task-dependencies.json Updates generated task graph.
libs/@local/status/typescript/docs/task-dependencies.json Updates generated task graph.
libs/@local/repo-chores/node/turbo.json Adds test build dependencies.
libs/@local/petrinaut-python/turbo.json Adds generated-model test dependency.
libs/@local/petrinaut-python/docs/task-dependencies.json Updates generated task graph.
libs/@local/petrinaut-optimizer-client/turbo.json Localizes generated-client test dependencies.
libs/@local/petrinaut-optimizer-client/docs/task-dependencies.json Updates generated task graph.
libs/@local/petrinaut-arch-docs/docs/task-dependencies.json Updates generated task graph.
libs/@local/hashql/eval/docs/task-dependencies.json Updates generated task graph.
libs/@local/hashql/compiletest/docs/task-dependencies.json Updates generated task graph.
libs/@local/hash-isomorphic-utils/turbo.json Moves build dependencies from codegen.
libs/@local/hash-isomorphic-utils/docs/task-dependencies.json Updates generated task graph.
libs/@local/hash-backend-utils/turbo.json Adds dependency builds for build and tests.
libs/@local/harpc/client/typescript/docs/task-dependencies.json Updates generated task graph.
libs/@local/graph/store/typescript/turbo.json Narrows codegen and build prerequisites.
libs/@local/graph/store/typescript/docs/task-dependencies.json Updates generated task graph.
libs/@local/graph/sdk/typescript/turbo.json Adds build prerequisites.
libs/@local/graph/postgres-store/turbo.json Adds manifest hashing to integration tests.
libs/@local/graph/postgres-store/docs/task-dependencies.json Updates generated task graph.
libs/@local/graph/client/typescript/turbo.json Separates codegen and build dependencies.
libs/@local/graph/authorization/typescript/turbo.json Localizes generated-type build dependencies.
libs/@local/graph/authorization/typescript/docs/task-dependencies.json Updates generated task graph.
libs/@local/graph/api/docs/task-dependencies.json Updates generated task graph.
libs/@local/effect-dns/core/docs/task-dependencies.json Updates generated task graph.
libs/@local/codec/typescript/turbo.json Separates Rust codegen from build hashing.
libs/@local/advanced-types/docs/task-dependencies.json Updates generated task graph.
libs/@hashintel/petrinaut/turbo.json Adds development and test build edges.
libs/@hashintel/petrinaut-cli/docs/task-dependencies.json Updates generated task graph.
libs/@hashintel/ds-components/turbo.json Moves dependency builds to consuming tasks.
libs/@hashintel/ds-components/docs/task-dependencies.json Updates generated task graph.
libs/@hashintel/brunch-agent/packages/plugin-sdcpn/turbo.json Adds test build dependencies.
libs/@hashintel/brunch-agent/packages/plugin-gherkin/turbo.json Adds test build dependencies.
libs/@hashintel/brunch-agent/packages/plugin-dafny/turbo.json Adds test build dependencies.
libs/@hashintel/brunch-agent/packages/core/turbo.json Removes unnecessary test prerequisites.
libs/@hashintel/brunch-agent/packages/binding-flue/turbo.json Adds test build dependencies.
libs/@blockprotocol/type-system/typescript/turbo.json Localizes codegen and codec dependencies.
libs/@blockprotocol/type-system/typescript/docs/task-dependencies.json Updates generated task graph.
libs/@blockprotocol/graph/turbo.json Adds dependency builds.
apps/plugin-browser/turbo.json Localizes codegen, build, and development edges.
apps/plugin-browser/docs/task-dependencies.json Updates generated task graph.
apps/petrinaut-website/turbo.json Adds development generation and build edges.
apps/petrinaut-website/docs/task-dependencies.json Updates generated task graph.
apps/petrinaut-opt/turbo.json Connects generated Python models to service tasks.
apps/petrinaut-opt/docs/task-dependencies.json Updates generated task graph.
apps/hash-integration-worker/turbo.json Adds build and Graph-service dependencies.
apps/hash-integration-worker/docs/task-dependencies.json Updates generated task graph.
apps/hash-graph/turbo.json Localizes service startup chains.
apps/hash-graph/docs/task-dependencies.json Updates generated task graph.
apps/hash-frontend/turbo.json Adds targeted generation, build, and service edges.
apps/hash-frontend/docs/task-dependencies.json Updates generated task graph.
apps/hash-api/turbo.json Adds aggregate build and startup dependencies.
apps/hash-api/docs/task-dependencies.json Updates generated task graph.
apps/hash-ai-worker-ts/turbo.json Adds build and Graph-service dependencies.
.claude/hooks/docs/task-dependencies.json Updates generated task graph.
Review details
  • Files reviewed: 64/64 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread turbo.json
indietyp
indietyp previously approved these changes Sep 7, 2026
@TimDiekmann
TimDiekmann added this pull request to the merge queue Sep 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 7, 2026
… root

The root `turbo.json` chained `codegen → ^build`, `build → codegen` and
`test:unit → codegen, ^build` for every package, whether or not the
package had a `codegen`, imported anything from `dist`, or was a Rust
crate. The effect was a recursion that made every task wait for every
dependency's build, reached real tasks through phantoms — a `tsc --build`
of `@local/status` before generating the Graph's OpenAPI spec — and put
the linter's own build ahead of unrelated builds.

The names shared between the JavaScript packages and the Rust crates now
carry no edges at the root; each package declares what its tasks consume.
Names a single toolchain uses keep their defaults: `lint:tsc`,
`lint:eslint` and `fix:eslint` depend on `^build` because type-aware
linting resolves workspace imports from `dist`, and the Rust-only names
depend on `^manifest`.

`test:unit` and `test:integration` keep a root default of `^manifest`: a
test reads its dependencies' sources through its toolchain, so their
inputs belong in its hash whether or not a build runs first. Measured on
`@rust/error-stack#test:unit`, which no longer depends on `^build`: a
change in `error-stack-macros` still moves its hash, and back. Packages
that import from `dist` add `^build` themselves.

Edges the recursion supplied by accident and that are true are now
explicit: `petrinaut-opt`'s codegen reads the models `petrinaut-python`
generates, the frontend's codegen loads its GraphQL config and both Panda
presets from `dist`, and `dev` and `start` wait for what they serve.
Explicit edges the recursion would have covered stay where `^build` does
not reach them, such as the brunch plugins that are not dependencies of
the agent. `hash-api` gains a `build` that runs nothing of its own and
gathers its codegen and its dependencies' builds, which is what its image
and the packages that import it need from it; the recursion had never
included `@local/hash-backend-utils#build` there.

The checked-in task dependencies change in 30 packages. Every `codegen`
and `test:unit` sheds predecessors — 76 and 34 executed tasks, none of
them read by the task — and the lint tasks trade 46 predecessors reached
through phantom chains for 9 direct ones. The executed set of the four
service images is unchanged apart from the `hash-backend-utils` build.
@TimDiekmann
TimDiekmann force-pushed the t/sre-1033-declare-turbo-task-dependencies-where-they-hold-instead-of branch from 2fd4b03 to d0b9805 Compare September 7, 2026 10:07
`@rust/hash-graph-atlas` landed on main with a document generated under
the root recursion: its `start` and `test:*` tasks reached
`@local/status#build` through `@rust/hash-status#build`, a task that
does not exist.
@TimDiekmann
TimDiekmann requested a review from indietyp September 7, 2026 10:09
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs September 7, 2026 10:09 Inactive
@vercel
vercel Bot temporarily deployed to Preview – petrinaut September 7, 2026 10:09 Inactive
@github-actions

github-actions Bot commented Sep 7, 2026

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 $$26.1 \mathrm{ms} \pm 166 \mathrm{μs}\left({\color{gray}-0.338 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.82 \mathrm{ms} \pm 16.9 \mathrm{μs}\left({\color{gray}-1.282 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$11.6 \mathrm{ms} \pm 63.0 \mathrm{μs}\left({\color{gray}1.16 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$38.5 \mathrm{ms} \pm 379 \mathrm{μs}\left({\color{gray}2.95 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$11.4 \mathrm{ms} \pm 93.9 \mathrm{μs}\left({\color{gray}1.20 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$21.2 \mathrm{ms} \pm 160 \mathrm{μs}\left({\color{gray}2.89 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$26.9 \mathrm{ms} \pm 179 \mathrm{μs}\left({\color{gray}-0.503 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.08 \mathrm{ms} \pm 23.6 \mathrm{μs}\left({\color{gray}-0.852 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$12.6 \mathrm{ms} \pm 109 \mathrm{μs}\left({\color{gray}0.707 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.12 \mathrm{ms} \pm 23.1 \mathrm{μs}\left({\color{gray}-0.879 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.41 \mathrm{ms} \pm 9.44 \mathrm{μs}\left({\color{gray}-0.876 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$2.73 \mathrm{ms} \pm 14.0 \mathrm{μs}\left({\color{gray}0.225 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$4.46 \mathrm{ms} \pm 24.2 \mathrm{μs}\left({\color{gray}-0.545 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.01 \mathrm{ms} \pm 18.5 \mathrm{μs}\left({\color{gray}1.93 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$3.47 \mathrm{ms} \pm 22.9 \mathrm{μs}\left({\color{gray}0.277 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$3.76 \mathrm{ms} \pm 26.1 \mathrm{μs}\left({\color{gray}-0.186 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.84 \mathrm{ms} \pm 19.4 \mathrm{μs}\left({\color{gray}1.12 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$3.42 \mathrm{ms} \pm 22.1 \mathrm{μs}\left({\color{gray}-0.662 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.15 \mathrm{ms} \pm 12.5 \mathrm{μs}\left({\color{gray}-0.769 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.10 \mathrm{ms} \pm 10.4 \mathrm{μs}\left({\color{gray}-2.698 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$2.20 \mathrm{ms} \pm 13.8 \mathrm{μs}\left({\color{gray}-2.122 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.40 \mathrm{ms} \pm 12.1 \mathrm{μs}\left({\color{gray}-1.313 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.27 \mathrm{ms} \pm 14.0 \mathrm{μs}\left({\color{gray}0.194 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.49 \mathrm{ms} \pm 17.6 \mathrm{μs}\left({\color{gray}-0.717 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$2.51 \mathrm{ms} \pm 17.0 \mathrm{μs}\left({\color{gray}1.15 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.26 \mathrm{ms} \pm 10.3 \mathrm{μs}\left({\color{gray}2.52 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$2.39 \mathrm{ms} \pm 14.3 \mathrm{μs}\left({\color{gray}2.24 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$2.84 \mathrm{ms} \pm 14.3 \mathrm{μs}\left({\color{gray}0.460 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.43 \mathrm{ms} \pm 9.96 \mathrm{μs}\left({\color{gray}-0.585 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$2.66 \mathrm{ms} \pm 16.0 \mathrm{μs}\left({\color{gray}1.69 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$2.78 \mathrm{ms} \pm 17.5 \mathrm{μs}\left({\color{gray}1.72 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.46 \mathrm{ms} \pm 14.0 \mathrm{μs}\left({\color{gray}-0.538 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$2.67 \mathrm{ms} \pm 15.6 \mathrm{μs}\left({\color{gray}1.07 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$26.9 \mathrm{ms} \pm 121 \mathrm{μs}\left({\color{gray}-0.927 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$66.6 \mathrm{ms} \pm 441 \mathrm{μs}\left({\color{gray}-0.581 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$30.6 \mathrm{ms} \pm 165 \mathrm{μs}\left({\color{gray}2.91 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$34.7 \mathrm{ms} \pm 173 \mathrm{μs}\left({\color{gray}-1.021 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$36.6 \mathrm{ms} \pm 248 \mathrm{μs}\left({\color{gray}1.08 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$29.2 \mathrm{ms} \pm 143 \mathrm{μs}\left({\color{gray}0.863 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$412 \mathrm{ms} \pm 992 \mathrm{μs}\left({\color{gray}-2.362 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$79.3 \mathrm{ms} \pm 519 \mathrm{μs}\left({\color{gray}0.486 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$79.3 \mathrm{ms} \pm 357 \mathrm{μs}\left({\color{gray}0.317 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$265 \mathrm{ms} \pm 740 \mathrm{μs}\left({\color{red}11.3 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$8.29 \mathrm{ms} \pm 37.3 \mathrm{μs}\left({\color{gray}-1.202 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$8.56 \mathrm{ms} \pm 41.9 \mathrm{μs}\left({\color{gray}1.10 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$8.59 \mathrm{ms} \pm 44.4 \mathrm{μs}\left({\color{gray}-0.243 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$8.63 \mathrm{ms} \pm 58.3 \mathrm{μs}\left({\color{gray}1.47 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$8.54 \mathrm{ms} \pm 49.4 \mathrm{μs}\left({\color{gray}-1.186 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$8.39 \mathrm{ms} \pm 43.8 \mathrm{μs}\left({\color{gray}-0.335 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$8.47 \mathrm{ms} \pm 47.4 \mathrm{μs}\left({\color{gray}1.41 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$8.55 \mathrm{ms} \pm 42.3 \mathrm{μs}\left({\color{gray}1.80 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$8.58 \mathrm{ms} \pm 52.1 \mathrm{μs}\left({\color{gray}1.18 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$9.00 \mathrm{ms} \pm 48.6 \mathrm{μs}\left({\color{gray}0.193 \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 $$8.81 \mathrm{ms} \pm 55.3 \mathrm{μs}\left({\color{gray}0.420 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$8.84 \mathrm{ms} \pm 46.1 \mathrm{μs}\left({\color{gray}0.935 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$8.76 \mathrm{ms} \pm 50.1 \mathrm{μs}\left({\color{gray}-1.376 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$8.82 \mathrm{ms} \pm 53.3 \mathrm{μs}\left({\color{gray}0.776 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$8.81 \mathrm{ms} \pm 43.0 \mathrm{μs}\left({\color{gray}-0.260 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$9.02 \mathrm{ms} \pm 51.6 \mathrm{μs}\left({\color{gray}1.82 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$8.89 \mathrm{ms} \pm 44.5 \mathrm{μs}\left({\color{gray}0.925 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$8.81 \mathrm{ms} \pm 42.2 \mathrm{μs}\left({\color{gray}-0.777 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$8.81 \mathrm{ms} \pm 52.4 \mathrm{μs}\left({\color{gray}-2.366 \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.45 \mathrm{ms} \pm 41.2 \mathrm{μs}\left({\color{gray}1.45 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$50.6 \mathrm{ms} \pm 368 \mathrm{μs}\left({\color{gray}-1.136 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$93.0 \mathrm{ms} \pm 405 \mathrm{μs}\left({\color{gray}-1.163 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$56.3 \mathrm{ms} \pm 555 \mathrm{μs}\left({\color{gray}0.259 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$64.2 \mathrm{ms} \pm 389 \mathrm{μs}\left({\color{gray}0.330 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$71.3 \mathrm{ms} \pm 397 \mathrm{μs}\left({\color{gray}0.168 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$77.0 \mathrm{ms} \pm 464 \mathrm{μs}\left({\color{gray}0.583 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$41.7 \mathrm{ms} \pm 237 \mathrm{μs}\left({\color{gray}-0.852 \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 $$64.3 \mathrm{ms} \pm 364 \mathrm{μs}\left({\color{gray}-0.430 \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 $$47.4 \mathrm{ms} \pm 274 \mathrm{μs}\left({\color{gray}-0.061 \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 $$55.0 \mathrm{ms} \pm 432 \mathrm{μs}\left({\color{gray}1.95 \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 $$56.1 \mathrm{ms} \pm 327 \mathrm{μs}\left({\color{gray}0.981 \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 $$56.1 \mathrm{ms} \pm 348 \mathrm{μs}\left({\color{gray}0.380 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$101 \mathrm{ms} \pm 724 \mathrm{μs}\left({\color{gray}-1.284 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$110 \mathrm{ms} \pm 459 \mathrm{μs}\left({\color{gray}-2.314 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$19.8 \mathrm{ms} \pm 109 \mathrm{μs}\left({\color{gray}-3.207 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$445 \mathrm{ms} \pm 1.02 \mathrm{ms}\left({\color{gray}-1.888 \mathrm{\%}}\right) $$ Flame Graph

@TimDiekmann
TimDiekmann added this pull request to the merge queue Sep 7, 2026
Merged via the queue into main with commit 76497be Sep 7, 2026
224 checks passed
@TimDiekmann
TimDiekmann deleted the t/sre-1033-declare-turbo-task-dependencies-where-they-hold-instead-of branch September 7, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash.design Affects the `hash.design` design site (app) area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-api Affects the HASH API (app) area/apps > hash-graph area/apps area/libs Relates to first-party libraries/crates/packages (area) area/tests > integration New or updated integration tests area/tests > playwright New or updated Playwright tests area/tests New or updated tests type/eng > backend Owned by the @backend team type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

3 participants