implement sigmoid function precision#265
Open
AbdulSnk wants to merge 2 commits into
Open
Conversation
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.
Refines the Sybil scoring module to resolve floating-point precision issues identified during the audit.
🧠 Problem Context & Fix
The Issue: Traditional floating-point math introduced precision drift and non-deterministic behavior in the sigmoid function calculation.
The Fix: Migrated the calculations to fixed-point math to guarantee precise, deterministic scoring across all environments.
🛠️ Technical Scope & Changes
Core Logic: Replaced standard division/exponential logic with a fixed-point math implementation for the sigmoid function.
Testing: Added targeted unit tests to validate precision bounds and ensure compliance with protocol invariants.
✅ Checklist
[x] Sigmoid precision fixed using fixed-point math.
[x] Unit tests executed and passed.
[x] Protocol invariants verified; zero regressions.
Closes #220