Skip to content

fix(authz): reuse hierarchy and entity selector indexes - #3991

Draft
strantalis wants to merge 2 commits into
codex/authz-perf/bulk-reusefrom
codex/authz-perf/evaluation-indexes
Draft

strantalis wants to merge 2 commits into
codex/authz-perf/bulk-reusefrom
codex/authz-perf/evaluation-indexes

Conversation

@strantalis

@strantalis strantalis commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

Build hierarchy ranks with the PDP and select the highest matching entitlement once per definition and decision. Index flattened selectors once per entity and deduplicate selectors before matched-mapping lookups.

Layer 4 of 4, based on #3990 and rebased on main at f992b60d. The merged #3983 workload replaces the superseded proof layer, #3993.

Before this rebase, all three implementations passed 800 mixed requests, 200 at each concurrency level of 1/10/25/50, with identical sampled cases. At 50 concurrent requests:

Implementation p95 Failures
Before #3986 8.72 s 0/200
#3986 alone 180 ms 0/200
Full stack 180 ms 0/200

Single local run per implementation and concurrency level on an 8-vCPU/16-GiB Colima VM. Same Go 1.26.3 compiler and Linux/arm64 runtime; setup excluded; caching and experimental features disabled. The measured improvement comes from #3986. The remaining layers showed no additional benefit in this workload.

Rebase verification (2026-10-05): all remaining patches are unchanged and based on main with #3987 merged. Authorization race tests, SDK README tests, formatting, and lint for the stack diff passed. Full repository checks were not rerun for this unchanged-patch synchronization; the prior local run required Docker and the platform at localhost:8080, and full lint reported existing findings in unchanged files. Earlier performance measurements above were not rerun locally.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size/m label Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

X-Test Failure Report

@strantalis strantalis changed the title perf(authz): reuse hierarchy and entity selector indexes fix(authz): reuse hierarchy and entity selector indexes Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 216.847517ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 125.522248ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 402.201686ms
Throughput 248.63 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 42.033415289s
Average Latency 419.479491ms
Throughput 118.95 requests/second

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 209.440863ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 123.456335ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 412.839231ms
Throughput 242.23 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 41.426910494s
Average Latency 413.345555ms
Throughput 120.69 requests/second

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

X-Test Failure Report

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 221.048414ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 113.604683ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 411.583437ms
Throughput 242.96 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 45.017832197s
Average Latency 448.955331ms
Throughput 111.07 requests/second

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 244.167163ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 122.929513ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 411.893474ms
Throughput 242.78 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 44.892218405s
Average Latency 447.979933ms
Throughput 111.38 requests/second

@strantalis
strantalis force-pushed the codex/authz-perf/evaluation-indexes branch from e259715 to c7e5a8b Compare October 1, 2026 21:03
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

X-Test Failure Report

@strantalis
strantalis removed this pull request from stack #3992 October 1, 2026 21:07
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 110.115809ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 64.058201ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 242.800772ms
Throughput 411.86 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 26.939483184s
Average Latency 268.781058ms
Throughput 185.60 requests/second

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 228.078879ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 150.984915ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 412.826972ms
Throughput 242.23 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 44.863131936s
Average Latency 447.498337ms
Throughput 111.45 requests/second

@strantalis
strantalis force-pushed the codex/authz-perf/evaluation-indexes branch from c7e5a8b to 7a9a567 Compare October 1, 2026 22:10
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

X-Test Failure Report

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 219.047951ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 136.791509ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 420.319519ms
Throughput 237.91 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 44.999904322s
Average Latency 449.14968ms
Throughput 111.11 requests/second

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 224.65715ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 121.138769ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 435.938595ms
Throughput 229.39 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 44.362109534s
Average Latency 442.799033ms
Throughput 112.71 requests/second

@jakedoublev
jakedoublev force-pushed the codex/authz-perf/evaluation-indexes branch from 7a9a567 to dc6a597 Compare October 2, 2026 19:45
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 224.181893ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 130.128111ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 418.00614ms
Throughput 239.23 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 43.787596948s
Average Latency 436.96236ms
Throughput 114.19 requests/second

@strantalis
strantalis force-pushed the codex/authz-perf/evaluation-indexes branch from dc6a597 to fc4e4f1 Compare October 4, 2026 22:47
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

X-Test Failure Report

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 212.981332ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 128.804949ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 423.908566ms
Throughput 235.90 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 45.179729293s
Average Latency 450.646657ms
Throughput 110.67 requests/second

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 253.868898ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 136.98231ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 408.774361ms
Throughput 244.63 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 45.372436063s
Average Latency 452.539339ms
Throughput 110.20 requests/second

@strantalis
strantalis force-pushed the codex/authz-perf/evaluation-indexes branch from fc4e4f1 to 865e887 Compare October 5, 2026 17:08
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Benchmark authorization.GetDecisions Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 172.651719ms

Benchmark authorization.v2.GetMultiResourceDecision Results:

Metric Value
Approved Decision Requests 1000
Denied Decision Requests 0
Total Time 99.787099ms

Benchmark Statistics

Name № Requests Avg Duration Min Duration Max Duration

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 356.04901ms
Throughput 280.86 requests/second

TDF3 Benchmark Results:

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 38.243700202s
Average Latency 381.784433ms
Throughput 130.74 requests/second

Signed-off-by: strantalis <strantalis@virtru.com>
Signed-off-by: strantalis <strantalis@virtru.com>
@strantalis
strantalis force-pushed the codex/authz-perf/evaluation-indexes branch from 865e887 to 4c4b6b9 Compare October 6, 2026 20:08
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

X-Test Failure Report

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 410.151729ms
Throughput 243.81 requests/second

TDF3 Benchmark Results

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 43.383521221s
Average Latency 432.737384ms
Throughput 115.25 requests/second

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor
Benchmark results, click to expand

Bulk Benchmark Results

Metric Value
Total Decrypts 100
Successful Decrypts 100
Failed Decrypts 0
Total Time 430.715522ms
Throughput 232.17 requests/second

TDF3 Benchmark Results

Metric Value
Total Requests 5000
Successful Requests 5000
Failed Requests 0
Concurrent Requests 50
Total Time 45.408267342s
Average Latency 452.842591ms
Throughput 110.11 requests/second

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Govulncheck found vulnerabilities ⚠️

The following modules have known vulnerabilities:

  • otdfctl
  • service
  • tests-bdd

See the workflow run for details.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant