Skip to content

Fix index crash on invalid $vocabulary#1013

Merged
jviotti merged 1 commit into
mainfrom
new-blaze-fix
Jun 4, 2026
Merged

Fix index crash on invalid $vocabulary#1013
jviotti merged 1 commit into
mainfrom
new-blaze-fix

Conversation

@jviotti
Copy link
Copy Markdown
Member

@jviotti jviotti commented Jun 4, 2026

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Jun 4, 2026

🤖 Augment PR Summary

Summary: Prevents index-time crashes when a metaschema/dialect provides an invalid $vocabulary by handling type mismatches defensively.

Changes: Updates the vendored Blaze revision, replaces debug assertions in vocabulary parsing with nullopt returns, and refreshes the CLI regression test for the invalid $vocabulary case.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

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

}

assert(vocabulary_entry->is_object());
if (!vocabulary_entry->is_object()) {
Copy link
Copy Markdown

@augmentcode augmentcode Bot Jun 4, 2026

Choose a reason for hiding this comment

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

Returning std::nullopt here makes an invalid $vocabulary indistinguishable from a missing keyword; callers (e.g. vocabularies() using value_or) may silently proceed with a default vocabulary set instead of surfacing that the dialect is malformed.

Severity: medium

Other Locations
  • vendor/blaze/src/foundation/foundation.cc:521

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Benchmark Index (community)

Details
Benchmark suite Current: c12664f Previous: 19f29a9 Ratio
Add one schema (0 existing) 421 ms 853 ms 0.49
Add one schema (100 existing) 28 ms 28 ms 1
Add one schema (1000 existing) 83 ms 88 ms 0.94
Add one schema (10000 existing) 747 ms 698 ms 1.07
Update one schema (1 existing) 23 ms 22 ms 1.05
Update one schema (101 existing) 28 ms 30 ms 0.93
Update one schema (1001 existing) 83 ms 89 ms 0.93
Update one schema (10001 existing) 679 ms 710 ms 0.96
Cached rebuild (1 existing) 6 ms 6 ms 1
Cached rebuild (101 existing) 8 ms 8 ms 1
Cached rebuild (1001 existing) 28 ms 30 ms 0.93
Cached rebuild (10001 existing) 240 ms 254 ms 0.94
Index 100 schemas 634 ms 643 ms 0.99
Index 1000 schemas 1606 ms 1649 ms 0.97
Index 10000 schemas 13988 ms 14478 ms 0.97
Index 10000 schemas (custom meta-schema) 143974 ms 149691 ms 0.96

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Benchmark Index (enterprise)

Details
Benchmark suite Current: c12664f Previous: 19f29a9 Ratio
Add one schema (0 existing) 321 ms 392 ms 0.82
Add one schema (100 existing) 25 ms 32 ms 0.78
Add one schema (1000 existing) 70 ms 89 ms 0.79
Add one schema (10000 existing) 591 ms 952 ms 0.62
Update one schema (1 existing) 18 ms 26 ms 0.69
Update one schema (101 existing) 26 ms 30 ms 0.87
Update one schema (1001 existing) 71 ms 86 ms 0.83
Update one schema (10001 existing) 595 ms 683 ms 0.87
Cached rebuild (1 existing) 5 ms 8 ms 0.63
Cached rebuild (101 existing) 6 ms 9 ms 0.67
Cached rebuild (1001 existing) 19 ms 30 ms 0.63
Cached rebuild (10001 existing) 162 ms 248 ms 0.65
Index 100 schemas 594 ms 626 ms 0.95
Index 1000 schemas 1291 ms 1586 ms 0.81
Index 10000 schemas 11199 ms 14220 ms 0.79
Index 10000 schemas (custom meta-schema) 137589 ms 139769 ms 0.98

This comment was automatically generated by workflow using github-action-benchmark.

@jviotti jviotti merged commit cc9291f into main Jun 4, 2026
5 checks passed
@jviotti jviotti deleted the new-blaze-fix branch June 4, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant