Skip to content

spacevalue.cargo: economicspace's cargo valuation moves here verbatim (0.2.0) - #4

Merged
loggger101 merged 2 commits into
mainfrom
release-0.2.0
Oct 26, 2026
Merged

loggger101 merged 2 commits into
mainfrom
release-0.2.0

Conversation

@loggger101

Copy link
Copy Markdown
Owner

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 from modules/calc.py at calc 1.32.0 (economicspace 0bd4be6). No price and no economicspace number moves; the data contract stays 1.17.0.

Proof of the move

  • Extracted programmatically: cargo.py's body is byte-identical to calc's span (comments included) and all 47 definitions have unchanged ast.dump; the proof failed on a planted one-token edit.
  • tests/test_cargo_golden.py replays 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 as repr; arguments compared before and after (the knapsack spends caps). A planted re-association (total / frac -> total * (1.0 / frac)) fails it.

Other changes

  • import spacevalue resolves names lazily (PEP 562), so import spacevalue.cargo loads neither the catalog nor spacecost (Stage 4 workers import it at spawn). test_rules holds this, and fails on a planted eager import.
  • Consumer contract names the 25 cargo names calc imports, plus the recorder codec (spacevalue._cargo_codec).
  • Version 0.2.0; CHANGELOG, README ("What a hold is worth"), CLAUDE.md rules for cargo.py.

Local suite: 94 passed; quotes check OK.

… (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.
@loggger101
loggger101 merged commit d12f626 into main Oct 26, 2026
11 checks passed
@loggger101
loggger101 deleted the release-0.2.0 branch October 26, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant