Repository navigation
Apply rc.7 simulation cap and floor rules - #5
Conversation
|
Thanks for the rc.7 update. You noted that the Rust tests could not run on your machine, so I ran your 41 cases on the Rust rule engine (integration branch, interface 1.0.0-rc.7). 33 match and 8 do not. None of the 8 shows an engine bug. Five need a fix on your side, and three are questions where I give you the answer to use. The hash of cap-cases.json matches your PR (fc435c11...), and Fix in the model (2)
Fix in the vectors (3)
Questions, with the answer to use (3)
METHOD.md
After these fixes, please export cap-cases.json again (still 1.0.0-rc.7) and push to this PR. I will rerun all 41 cases and post the result. If you can push by 11:00 UTC today (14 Nov), the cross-check can still make this release. |
|
Thanks for the quick fix. I ran all 42 cases from 5165885 on the Rust rule engine again. 33 match and 9 do not. None of the 9 shows an engine bug. Your regenerated cap-cases.json is byte-identical to the committed one, and the 32 Python tests pass. Fixed: What is left is float rounding in the model. The engine works in whole base units, so the model must compare in base units too.
Two text updates:
If you can push by 11:00 UTC, I will run the cases again the same hour. |
|
Thanks, d5b970d fixes all three items. I ran the 42 cases again: 37 match under the rules from my last comment, and 5 do not. None of the 5 shows an engine bug. The hash in the PR description matches, the regenerated file is byte-identical, and the 32 Python tests pass. For the record, "match" here means: fill, limit_reason and refusal_code are equal; numeric fields agree within a relative 1e-8; and One cause for the 5 cases The buy output is now an integer, but these sells still take their amount from the float balance. The amount is then a few base units above what the account holds.
Line 513 already does this right: it passes One more point: the model's integer buy and the engine's buy can differ by up to about 1.5e11 base units. A vector that sells the model's exact buy amount works only when the engine bought the same or more, so selling METHOD.md The paragraph on accepted differences names the wrong cases. At d5b970d, If you can push by 11:00 UTC, I will run the cases again the same hour. |
|
7430a6d passes the cross-check. I ran all 42 cases on the Rust rule engine: all 42 match under the rules from my last comment, with fill, limit_reason and refusal_code exact in every case. The hash in the PR description matches (522483dd...), the regenerated file is byte-identical, and the 32 Python tests pass. Thanks for the fast turnaround on all three rounds. I also ran a code review on the full diff, for the parts the 42 cases do not reach. Nothing blocks the cross-check, but two items change results outside the vectors. Could you fix these in a follow-up commit on this PR, by 11:00 UTC if you can? Fix
Tests
METHOD.md
Small notes, no change needed now: When you push, I will run the 42 cases again and post the result. |
|
163bc16 fixes everything from my last comment. Thanks for turning it around so early. What I checked:
One small nit, not a blocker: the new creator test covers the 4% creator cap on transfers (simulate.py:141), not on buys (simulate.py:123). A change to the buy-side cap still passes every test. One more assertion in that test would cover it, if you have a minute. I will follow up here about the merge. |
|
Following up on the merge: this PR is in One more ask, if you have time today: #4, the short To make it into the submission, I need the PR by 17:00 UTC (18:00 WAT) today, so there is time to review and merge it before our freeze. If today does not work, just say so here and I will close #4 for now. No problem either way. The creator buy-cap test I mentioned is still optional and not needed for this. |
Summary
Implements the rc.7 sell-rule model and Rust comparison vectors, including one shared marked/unmarked floor, marked-cap holds, creator fee share, and integer token-base-unit fill decisions.
Contract comparison
analysis/simulation/results/cap-cases.jsonuses interface1.0.0-rc.7, contains 42 cases, and has SHA-256522483dd44113deacf11f3c357e61481aa0124504943e24a497a55a4012eb0c9.all) when the account has no unrelated balance; targeted resells use integer buy output. Fill status compares filled base units with the submitted base-unit amount.cap_left_yoctoandcap_left_before_yoctodifferences, within 1e9 yoctoNEAR, are listed inanalysis/simulation/METHOD.md.Verification
python3 -m unittest discover -s tests -v— 41 passed.git diff --checkpasses.Merge Danger
Door: Two-way
Blast Radius: Analysis model, generated simulation tables, and findings only.