Repository navigation
Update the vendored BNGsim expression layer to 4361958 - #120
Merged
Merged
Conversation
The copy under third_party/bngsim_expr was pinned to BNGsim 6ce2276 (PR #100). Later BNGsim commits change expression.hpp and expression.cpp: - mratio() (lanl/bngsim#768, lanl/bngsim#1080). It trusted Gauss's continued fraction in regions where the fraction converges to a false limit or loses digits. It now sums a = 0 exactly, sums both Kummer series inside |z| <= 20 and in the corner a <= 0, z < -20, b - a < 1, takes the fraction's second step as exactly 1 so that a tiny b no longer leaks through, and refuses b <= 0 where nothing it has can vouch for the answer. Through RuleMonkey's standalone evaluator, mratio(0, 1, 100) was 1.282e15 on main for (e^100 - 1)/100 = 2.688e41, and is 2.688e41 now; mratio(0, 0.5, 40) was -4.09e15 and is 3.30e16. mratio(1, 2, 3) and mratio(-3, 1, 5) are unchanged. - define_function() throws when the symbol table refuses a name (lanl/bngsim#772). RuleMonkey does not call it. - ExpressionEvaluator gains try_define_variable() (lanl/bngsim#919), and a name define_variable() refuses for not being an identifier is now reported as such, not as a duplicate (a5c957d). RuleMonkey does not subclass ExpressionEvaluator, and no test pins the old message. bngsim's vendor_rulemonkey.py refuses to vendor RuleMonkey while this copy differs from bngsim's own (EXPRTK_SYNC_FILES), so the next release can be vendored only once this lands. Inside a BNGsim build nothing changes, because CMake links the host bngsim::expression target and this copy is not compiled; vendored 3.11.0 already runs on this layer there. Standalone, rm_driver --print-functions output and exit code match main byte for byte on all 262 XMLs under tests/, two seeds each, run from t = 0 and from --t-start 5. No model under tests/ calls mratio(), so the corpus cannot see the fix; the numbers above are from a probe compiled against both copies. Refreshed with scripts/vendor_exprtk.py, which also rewrote VENDOR and VENDOR.json. exprtk.hpp and expr_compat.hpp are unchanged. Not changelogged, as RELEASING.md says for a contents refresh. Verified: ctest 67/67, harness/basicmodels.py 29/29, scripts/vendor_exprtk.py --check OK.
This was referenced Oct 23, 2026
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a prerequisite for vendoring 3.12.0 into BNGsim.
bngsim/scripts/vendor_rulemonkey.pyrefuses to vendor RuleMonkey whilethird_party/bngsim_exprdiffers from BNGsim's own expression layer (EXPRTK_SYNC_FILES, RELEASING.md step 7). That layer has moved since PR #100 pinned it at 6ce2276; this re-pins it to BNGsim main at 4361958.What moves
mratio()stops trusting Gauss's continued fraction where it converges to a false limit or loses digits. It sums a = 0 exactly, sums both Kummer series inside |z| <= 20 and in the corner a <= 0, z < -20, b - a < 1, takes the fraction's second step as exactly 1, and refuses b <= 0 where nothing can vouch for the answer.mratio(0, 1, 100)was 1.282e15 onmainfor (e^100 - 1)/100 = 2.688e41, and is 2.688e41 now.mratio(0, 0.5, 40)was -4.09e15 and is 3.30e16.mratio(1, 2, 3)andmratio(-3, 1, 5)are unchanged. Measured with a probe compiled against both copies.define_function()throws when the symbol table refuses a name.ExpressionEvaluatorgainstry_define_variable(). A namedefine_variable()refuses because it is not an identifier is now reported as such, not as a duplicate.ExpressionEvaluator, and no test pins the old message.exprtk.hppandexpr_compat.hppare unchanged. Inside a BNGsim build nothing changes: CMake links the hostbngsim::expressiontarget and this copy is not compiled, so the vendored 3.11.0 already runs on this layer there.Blast radius (standalone)
rm_driver --print-functionsstdout and exit code matchmainbyte for byte on all 262 XMLs undertests/, two seeds each, run from t = 0 and from--t-start 5. No model undertests/callsmratio(), so the corpus cannot see the fix.Refreshed with
scripts/vendor_exprtk.py, which also rewroteVENDORandVENDOR.json. Not changelogged, as RELEASING.md says for a contents refresh (#58, #78, #100).Verified: ctest 67/67,
harness/basicmodels.py29/29,scripts/vendor_exprtk.py --checkOK. pre-commit skipsthird_party/by design.