-
Notifications
You must be signed in to change notification settings - Fork 0
Fuzzy testing framework cleanup and drift reporting #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kgrgpg
wants to merge
20
commits into
main
Choose a base branch
from
parameterized-fuzzy-testing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
- Created Python simulator (tidal_simulator.py) with 9-decimal precision - Implemented extended simulator for scenarios 1-10 with fuzzy testing - Generated 13 Cadence test files from CSV scenarios - Fixed yield price monotonic constraint (only increase/stay same) - Added comprehensive test generation framework (generate_cadence_tests.py) - Fixed test patterns to match existing tests (force rebalancing, proper measurements) - Created precision comparison and reporting tools - Fixed position ID issues and Cadence syntax errors - Added extensive documentation and test reports Test Status: - 8/13 generated tests passing (62%) - 3/13 have minor calculation variances (1-3%) - 2/13 have syntax issues to fix All existing tests continue to pass (100%)
- Added 7 test scenarios with CSV configurations for various edge cases - Implemented tidal_protocol_simulator.py for protocol simulation - Created simple_cadence_test_generator.py for automated test generation - Generated Cadence test files for scenarios 1-5 and 3a-3d variations - Added unified test suite documentation - Included precision analysis and comparison reports - Updated existing scenario CSV files with refined test parameters
…io7/9 per case; strict 1e-7 comparisons with per-step DRIFT logging; new run_fuzzy.sh; cleaned outdated docs; preserved legacy tests; updated FUZZY_TESTING.md and drift report.
…1 post-rebalance semantics; drift report covers split tests
… semantics; drift report over split tests
…splits S8; drift report includes S8 per-walk; scenario mapping + strict tolerance retained
… and regenerate tests; update drift report; keep strict tolerance
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.
Overview
This PR cleans up and unifies the fuzzy-testing stack so we can generate deterministic scenario CSVs, produce Cadence tests with strict precision checks, and generate a per-step drift report to diagnose any mismatches. Legacy tests remain intact and continue to serve as the baseline for Scenarios 1–3.
Why
Key changes
Compact CSV numbering (1–9)
Scenario1_FLOW.csvScenario2_Instant.csvScenario3_Path_{A,B,C,D}_precise.csvScenario4_VolatileMarkets.csvScenario5_GradualTrends.csvScenario6_EdgeCases.csvScenario7_MultiStepPaths_{Bear,Bull,Sideways,Crisis}.csvScenario8_RandomWalks.csvScenario9_ExtremeShocks_{FlashCrash,Rebound,YieldHyperInflate,MixedShock}.csvScenario splits
Generator (Cadence tests)
cadence/tests/DRIFT|<Label>|<step>|<actualDebt>|<expectedDebt>|<actualY>|<expectedY>|<actualColl>|<expectedColl>Actionsin order, then validateDrift report
precision_reports/generate_drift_report.pydiscovers scenario tests dynamically and runs themprecision_reports/UNIFIED_FUZZY_DRIFT_REPORT.mdOne-command runner
scripts/run_fuzzy.sharchives previous artifacts and runs the full pipeline:Scenario*.csv, generated tests, and the last drift report intoarchives/fuzzy_run_<timestamp>/pandasDocumentation
FUZZY_TESTING.mdwith clear instructions, and linked the one-command shortcutREADME.md,UNIFIED_TEST_SUITE.md,FUZZY_TESTING.md, andprecision_reports/UNIFIED_FUZZY_DRIFT_REPORT.mdCleanup
rebalance_scenario{1,2}_test.cdcandrebalance_scenario3{a,b,c,d}_test.cdcHow to run locally
Scenario*.csv)cadence/tests/rebalance_scenario*_test.cdcprecision_reports/UNIFIED_FUZZY_DRIFT_REPORT.mdPrecision and semantics
Debt,YieldUnits, andCollateralVerification notes
Impact
bash scripts/run_fuzzy.shto regenerate artifacts and rebuild the drift reportFollow-ups (optional)
Actionssemantics or generator step order on specific rows to eliminate remaining large drifts while maintaining the strict toleranceUNIFIED_FUZZY_DRIFT_REPORT.mdfor quick review on PRsChecklist
FUZZY_TESTING.md) and simplifiedscripts/run_fuzzy.shfor archive + regen + report