Skip to content

Upgrade Blaze to 83e2458856b934aa7995c44da36ab09152bdfc8d#806

Merged
jviotti merged 1 commit intomainfrom
blaze-new
Apr 2, 2026
Merged

Upgrade Blaze to 83e2458856b934aa7995c44da36ab09152bdfc8d#806
jviotti merged 1 commit intomainfrom
blaze-new

Conversation

@jviotti
Copy link
Copy Markdown
Member

@jviotti jviotti commented Apr 2, 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 10 files

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Apr 2, 2026

🤖 Augment PR Summary

Summary: This PR upgrades the vendored blaze dependency to commit 83e2458, updating both the C++ compiler/evaluator and the JavaScript port.

Changes:

  • Adds a JSON template JSON_VERSION field and updates template serialization/parsing to include it.
  • Shifts template array indices (dynamic/track/targets/labels) to account for the new version element.
  • Introduces a native JS validator generator that emits specialized code for many opcodes and runs it when no callback is provided.
  • Adds a large set of JS “fast” opcode handlers and refactors the evaluator to use them by default.
  • Optimizes several hot paths (instance resolution, uniqueness checks, enum checks via Set).
  • Replaces URI validation via new URL() with a precompiled URI_REGEX.
  • Enhances the JS package for publishing (metadata, exports, types, README, LICENSE) and bumps it to 0.0.2.

Technical Notes: The JS port now conditionally uses generated validators for non-dynamic/non-tracking templates to reduce per-instruction overhead, while keeping the callback/tracking paths on the interpreter-based evaluator.

🤖 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. 2 suggestions posted.

Fix All in Augment

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

body += 'return true;';

try {
const fn = eval(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

vendor/blaze/ports/javascript/index.mjs:355: Using eval here means a crafted/hand-edited template could potentially inject executable JS because instruction fields are interpolated into generated code without strict type validation. If templates might be untrusted input, consider hard-validating numeric/string fields (or gating native codegen behind an explicit opt-in) before calling eval.

Severity: high

Fix This in Augment

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

if (evaluator.callbackMode) evaluator.callbackPop(instruction, false);
return false;
}
const __result = URI_REGEX.test(target);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

vendor/blaze/ports/javascript/index.mjs:1291: Switching AssertionStringType from new URL() to URI_REGEX significantly relaxes URI validation (e.g., invalid percent-encoding or other illegal characters may now pass). If this opcode is meant to implement JSON Schema format: uri semantics strictly, this could be a behavior regression.

Severity: medium

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 (enterprise)

Details
Benchmark suite Current: 5072a18 Previous: aca182e Ratio
Add one schema (0 existing) 21 ms 19 ms 1.11
Add one schema (100 existing) 26 ms 25 ms 1.04
Add one schema (1000 existing) 72 ms 73 ms 0.99
Add one schema (10000 existing) 599 ms 615 ms 0.97
Update one schema (1 existing) 18 ms 18 ms 1
Update one schema (101 existing) 24 ms 24 ms 1
Update one schema (1001 existing) 73 ms 74 ms 0.99
Update one schema (10001 existing) 606 ms 604 ms 1.00
Cached rebuild (1 existing) 12 ms 10 ms 1.20
Cached rebuild (101 existing) 12 ms 12 ms 1
Cached rebuild (1001 existing) 31 ms 32 ms 0.97
Cached rebuild (10001 existing) 250 ms 248 ms 1.01
Index 100 schemas 112 ms 143 ms 0.78
Index 1000 schemas 992 ms 1137 ms 0.87
Index 10000 schemas 13707 ms 12405 ms 1.10

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

@jviotti jviotti merged commit 3f2bc04 into main Apr 2, 2026
6 checks passed
@jviotti jviotti deleted the blaze-new branch April 2, 2026 18:03
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: 5072a18 Previous: aca182e Ratio
Add one schema (0 existing) 20 ms 16 ms 1.25
Add one schema (100 existing) 22 ms 19 ms 1.16
Add one schema (1000 existing) 74 ms 59 ms 1.25
Add one schema (10000 existing) 629 ms 499 ms 1.26
Update one schema (1 existing) 16 ms 14 ms 1.14
Update one schema (101 existing) 23 ms 19 ms 1.21
Update one schema (1001 existing) 77 ms 61 ms 1.26
Update one schema (10001 existing) 649 ms 511 ms 1.27
Cached rebuild (1 existing) 9 ms 8 ms 1.13
Cached rebuild (101 existing) 10 ms 9 ms 1.11
Cached rebuild (1001 existing) 30 ms 21 ms 1.43
Cached rebuild (10001 existing) 251 ms 159 ms 1.58
Index 100 schemas 121 ms 107 ms 1.13
Index 1000 schemas 1028 ms 845 ms 1.22
Index 10000 schemas 13250 ms 10928 ms 1.21

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

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