Merged
Conversation
dyumanaditya
approved these changes
Jan 29, 2026
Contributor
dyumanaditya
left a comment
There was a problem hiding this comment.
looks good @ColtonPayne
This was referenced Jan 30, 2026
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.
Fix BUG-125 and BUG-127: Delta Bound Convergence with IPL Complements
Summary
This PR fixes two critical bugs in the delta_bound convergence calculation when Inverse Predicate Law (IPL) complements are involved:
updated_bndsin_update_edgeBoth bugs affected convergence detection in
delta_boundmode, potentially causing premature convergence or incorrect convergence thresholds.BUG-125: Wrong Variable Appended in
_update_edgeSeverity: CRITICAL
Location:
interpretation.py:1649,interpretation_fp.py:1750Impact:
Convergence tracking received the wrong bound, causing incorrect delta calculations. The complement's actual delta was completely missed and replaced with a duplicate of the original predicate's bound.
Note: This bug only affected
_update_edge. The equivalent code in_update_nodewas already correct.BUG-127: Delta Comparisons Use Wrong Previous Bounds
Severity: CRITICAL
Locations:
interpretation.py:1541-1546(_update_node)interpretation.py:1659-1668(_update_edge)interpretation_fp.py:1659-1664(_update_node)interpretation_fp.py:1761-1766(_update_edge)Issue:
When calculating deltas in
delta_boundmode, all bounds inupdated_bnds(including IPL complements) were compared against the original label's previous bound instead of each bound's own previous bound.Impact:
Dramatically inflated or deflated convergence deltas for IPL complements, leading to incorrect convergence detection in
delta_boundmode.Files Modified
pyreason/scripts/interpretation/interpretation.py- Fixed both bugspyreason/scripts/interpretation/interpretation_fp.py- Fixed both bugsTests Added
Added comprehensive test cases to
test_reason_update.py:test_update_node_ipl_complement_delta_bound_bug127- Tests BUG-127 for nodes using infected/healthy predicates with two sequential updatestest_update_edge_ipl_two_complements_bug125- Tests BUG-125 with multiple IPL pairs (infected/healthy/recovered)All tests:
Here is a screenshot running the new tests from
main:All existing tests continue to pass.