Repository navigation
spacevalue.cargo: economicspace's cargo valuation moves here verbatim (0.2.0) - #4
Merged
Merged
Conversation
… (0.2.0) The mineral and phase walk, the inseparable phases, the flown refinery, the composition memo, the market ceilings and the payload knapsack, cut out of economicspace's modules/calc.py (calc 1.32.0, 0bd4be6) programmatically: the module body is byte-identical to calc's span and every definition's AST is unchanged. No price and no economicspace number moves. - import spacevalue resolves its names lazily (PEP 562), so a Stage 4 worker importing spacevalue.cargo loads neither the catalog nor spacecost; held by test_rules. - tests/test_cargo_golden.py replays 4,858 calls recorded inside calc 1.32.0 over thirteen cells (every market model, phase and refinery path) for the last bit; it fails on a planted re-association. - The consumer contract names the 25 cargo names calc imports.
…away on two calls macOS CI found that its C library rounds (1 + r) ** (-1 / e) one ulp away from Windows on 2 of 64 recorded saturation_price_multiplier calls; Linux matches exactly. Off the recording host only that pow-routed function is held to one ulp (and never on a quarter of its calls); everything else, and every call on the recording host, stays exact. A simulated 1-ulp host passes, the same perturbation on the recording host fails, and 2 ulp fails anywhere.
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.
Moves economicspace's Stage 4 cargo valuation (the phase walk, inseparable phases, flown refinery, composition memo, market ceilings and the payload knapsack) into
spacevalue.cargo, verbatim frommodules/calc.pyat calc 1.32.0 (economicspace0bd4be6). No price and no economicspace number moves; the data contract stays 1.17.0.Proof of the move
cargo.py's body is byte-identical to calc's span (comments included) and all 47 definitions have unchangedast.dump; the proof failed on a planted one-token edit.tests/test_cargo_golden.pyreplays 4,858 calls recorded inside calc 1.32.0 over thirteen small cells that reach every market model, the phase and four-fraction walks, detailed and plain phases, flown and deducted refinery, and the surplus wall. Every float compared asrepr; arguments compared before and after (the knapsack spendscaps). A planted re-association (total / frac->total * (1.0 / frac)) fails it.Other changes
import spacevalueresolves names lazily (PEP 562), soimport spacevalue.cargoloads neither the catalog nor spacecost (Stage 4 workers import it at spawn).test_rulesholds this, and fails on a planted eager import.spacevalue._cargo_codec).cargo.py.Local suite: 94 passed;
quotes checkOK.