You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…ity tests
AstEvaluatorCalculator re-parsed and re-mapped the formula on every apply(). For large
formulas (tens of KB) re-parsing dominated cost (~5.7s/eval at 12KB). Cache the typed
P4 AST for declaration-free formulas the typed path has already evaluated and reuse it
across apply() calls (structure only — context still varies). Repeated evaluation of a
12KB formula drops ~5717ms -> ~0.19ms; javacode cannot compile such formulas at all
(64KB method limit), so the interpreter is the only viable path for large expressions.
Tests (run on the fast interpreter):
- GrammarCoverageInterpreterTest: grammar-derived expressions and their runtime answers
(arithmetic, math fns, boolean precedence OR<AND<XOR, not nesting via if(...), control
flow, match, strings, variables, cache freshness).
- InterpreterJavacodeParityTest: proves interpreter == javacode on the common subset.
- KnownP4BugsTest (@ignore): reproductions of P4 interpreter bugs found while writing the
above — standalone not(...) always false (#25), variadic min/max & boolean precedence
overridden by cross-check (#21), math-function arithmetic (unlaxer-parser#43).
- BackendSpeedBenchmarkTest (@ignore): the perf benchmark.
pom: add -Dtinyexpression.skipRailroad to skip documentation-only SVG generation during
dev/test. surefire forkCount parallelism was tried but NOT enabled — several existing
tests share process-wide static state (JavaCodeBlockPolicy, Parser.get cache) and fail
under parallel forks; see docs/findings §6.
Findings, bugs and the test-instability root-cause analysis:
docs/findings-2026-06-15-unlaxer-3.0.4-and-p4.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
現 master の P4 実装の上に性能改善とテストを追加。詳細: docs/findings-2026-06-15-unlaxer-3.0.4-and-p4.md
主な変更
AstEvaluatorCalculator.cachedTypedAst): apply ごとの再パースを回避。12KB式の繰り返し評価 5717ms→0.19ms。javacode は ~4KB 超でコンパイル不能(64KBメソッド上限)のため巨大式はインタプリタが唯一解。-Dtinyexpression.skipRailroad追加。forkCount 並列は不採用(下記 §6 のテスト隔離問題)。発見したバグ(issue 化済み)
not(...)が _boolean で常に false(if内は正常)abs(-3)+pow(2,3)等 math関数算術(BinaryExpr オペランド型が狭い)テスト不安定性の調査
JavaCodeBlockPolicyのグローバル静的状態の実行順依存が主因(findings §6)。本PRは clean master 比で新規失敗ゼロ(検証済み範囲)。ローカルでは master 自体が一部環境要因で赤いため、CI での緑判定を依頼します。🤖 Generated with Claude Code