Repository navigation
Exact tick-built bar volume and a genuine-tick equivalence harness - #319
Merged
Merged
Conversation
A bar built from ticks must equal the same bar built offline from the same prints. Keep a Neumaier fallback for off-grid quantities and integer overflow. Hash all tick-volume accumulator state; tick stream hashes change forward-only. Confirmed-bar batch accumulation remains unchanged.
A bar built from ticks must equal the same bar built offline from the same prints. Omit default and redundant additive state from the tick-volume hash extension; retain every accumulator field when integer-grid or compensated state adds information. Preserve existing tick pins as well as bar and batch hashes.
| self.send_header("Content-Length", str(len(payload))) | ||
| self.end_headers() | ||
| self.wfile.write(payload) | ||
| except (BrokenPipeError, ConnectionResetError, TimeoutError): |
| try: | ||
| with sqlite3.connect(output / "orders.sqlite3", timeout=0.1) as ledger: | ||
| recorded = ledger.execute("SELECT COUNT(*) FROM inputs").fetchone()[0] | ||
| except sqlite3.Error: |
luisleo526
added a commit
that referenced
this pull request
Oct 3, 2026
Bring the PR up to date with main (#316, #317, #319) so the strict required-status rule can be satisfied again. Auto-merged cleanly; main's README changes are ABI declaration counts, not parity figures. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
luisleo526
added a commit
that referenced
this pull request
Oct 4, 2026
The 1.1.0 lead now says how state-hash values change while the epoch and the domain tags stay: a run whose fills an adapter change alters hashes to new values, and three changes fold more state, so a run can hash differently from 1.0.1 with byte-identical trades: #315 (an unbatched same-bar entry request and placement; the stream report's terminal re-mark leaves the hashed extremes; witness row Stream/0/1 re-pinned), #316 (an opening stop's next waypoint; Random44/0/0 and /1 re-pinned) and #319 (tick-volume state, every existing pin kept). In the runner tooling bullet, "No versioned engine PF_API export ... changes" and "Plugin-free ledger identity bytes remain unchanged" read as release-wide; they now speak for #320 itself and for a strategy without the checked settings calls. The Report keys intro points at the report schema page. The terminal-quote bullet names the chart feed that PINEFORGE_RUN_REPORT_CHART_QUOTE points at, and two runner bullet headings are re-wrapped. Replaces text introduced by a80485c (this branch's first commit): the lead's "A run whose fills one of the Pine adapter changes below alters hashes to new values, and [#316] adds one placement field to the adapter's hashed state, for which two witnesses with byte-identical trades were re-pinned.", the Report keys intro and the terminal-quote harness clause; and text introduced by dbd17b3 (#320): "No versioned engine PF_API export, native C++ surface, script ABI epoch or engine behavior changes." and "Plugin-free ledger identity bytes remain unchanged". Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
luisleo526
added a commit
that referenced
this pull request
Oct 4, 2026
… rule #325 (confirmed-bar streams compute what the batch computes) and #327 (docker/run_json.py --symbol-feeds) merged before the release notes, so their Unreleased bullets join the 1.1.0 section, rewritten and linked; no Unreleased heading stays. - CHANGELOG.md: the lead names the stream fix and, in the pairing sentence, codegen 1.1.0's request discovery (transpile_full()["requests"], codegen #164). #325's bullet says what a stream user sees; #327's bullet and its Report keys entry (applied_runtime.symbol_feeds, the --symbol-feeds: failure messages). A new State hashes section lists the four recipe additions since v1.0.1 (#315, #316, #319, #325; none removed, renamed or re-encoded; domain tags unchanged). #315's range-end equity-extreme change moves to the Pine adapter parity bullet as a behaviour fix. The #319 bullet named the broker-state hash; the change is in the native continuation hash, which the broker-state hash folds. The known-issue bullet now says it is fixed in 1.1.0 (#325). Migration gains a line on stream results and hashes. - README.md: the known issue is fixed in 1.1.0 (#325); the v1.1.0 Releases line gains the stream fix, request discovery and the harness's multi-symbol request.security feeds. Fact markers rendered from the facts export that maps releases[1.1.0] to pineforge-parity-baseline-20261004-engine-7b596622 (7,951 excellent / 38 strong of 7,989); the active scoreboard moves to the same baseline, here and in docs/pages/contributing-llm.md. - docs/pages/streaming.md: the known issue affected v1.0.0 and v1.0.1 and is fixed in 1.1.0. - docs/pages/public-contract.md: the state-hash rule, amended by the owner's ruling for 1.1.0. It covers the recipe only: a minor release may add a hashed field (domain tags unchanged, the added field changing no trade or report, disclosed under State hashes); removing, renaming or re-encoding a hashed field is a new epoch and a major release; behaviour changes follow the normal release and parity rules. The first uses are #315 and #316. The semver rule is unchanged. Replaces text introduced by 7b59662 (#325): CHANGELOG.md's "Confirmed-bar streams compute what the batch computes:" bullet, and the "Fixed on main (#325); included in the next release." lines of README.md and streaming.md; by 4f2a475 (#327): CHANGELOG.md's "Harness symbol feeds:" bullet; by d093560 (#290): public-contract.md's "State-hash values are stable within the epoch." and "a new recipe is a new epoch and a major release"; by a80485c (this branch's first commit): the "Known issue, as in v1.0.0 and v1.0.1" bullet, streaming.md's "(v1.0.0, v1.0.1, v1.1.0)", the #319 bullet's "A tick stream's broker-state hash folds the new accumulator state only where it adds information, so the existing tick, bar and batch hash pins hold.", the Report keys failure-output bullet and the v1.1.0 Releases line; by 66be240 and 83d64dc: the lead's state-hash sentences ("Three changes also change what the hashes fold"); and, as git attributes them through this branch's merge of main, by e59c09f: README.md's v1.1.0 Releases line and streaming.md's "(v1.0.0, v1.0.1, v1.1.0)". Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
luisleo526
added a commit
that referenced
this pull request
Oct 4, 2026
* docs: release notes and version scoping for v1.1.0 v1.1.0 is a minor release: <pineforge/pineforge.h> declares six more functions, the checked settings calls that a strategy generated by pineforge-codegen 1.1.0 exports (#317). It pairs with pineforge-codegen 1.1.0. PF_ABI_VERSION stays 4 (pineforge.h only gains declarations; native_c_api.h and the native C++ host headers are unchanged) and the script ABI epoch stays engine_script_run_v19. - CHANGELOG.md: "## Unreleased" becomes "## 1.1.0 — 2026-10-04": a lead paragraph, one bullet per change a user can observe since v1.0.1 (#312-#324), each linking its PR, a Report keys subsection (docker/run_json.py v1.0.1 -> v1.1.0) and a Migration subsection. The three Unreleased bullets stay; the lot-grid bullet now gives both failure messages. - README.md: pineforge-codegen==1.1.0, the v1.1.0 tarballs, the pairing sentence, the stream known issue's scope, the benchmark refresh line, the release scoreboard sentence (releases[1.1.0] markers) and a v1.1.0 line in Releases. The public corpus sweep's "311 excellent + 1 declared anomaly" is scoped to the v1.0.1 library it was measured on. Facts rendered from the facts file that adds releases[1.1.0]; the active scoreboard markers move to baseline pineforge-parity-baseline-20261003-engine-dbd17b38. - docs/pages/install.md: the v1.1.0 tarballs and the hub tag engine1.1.0-codegen1.1.0. - docs/pages/public-contract.md: 1.1.0's release line, engine v1.1.0 with codegen 1.1.0 among the supported pairs, and the four C-boundary rows that were planned for 1.1.0 are not in it. - docs/pages/streaming.md: the known issue's scope includes v1.1.0. Lines that state what an earlier version shipped or did stay. Replaces text introduced by dc74e63 (#318): README.md's "Release 1.0.1 still grades ... until the next release" sentence, now 1.1.0's; by d093560 (#290): public-contract.md's "Four of its rows are planned for 1.1.0"; by 783bb39 (#322): CHANGELOG.md's "The engine library is unchanged."; by dbd17b3 (#320): CHANGELOG.md's "The engine is unchanged."; by b2a578c (#300): README.md's "this repository's sweep: 311 excellent + 1 declared anomaly"; by 271d687 (#311): README.md's "its releases 1.0.0 and 1.0.1 do". Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * docs: state the 1.1.0 hash folds and scope two runner sentences The 1.1.0 lead now says how state-hash values change while the epoch and the domain tags stay: a run whose fills an adapter change alters hashes to new values, and three changes fold more state, so a run can hash differently from 1.0.1 with byte-identical trades: #315 (an unbatched same-bar entry request and placement; the stream report's terminal re-mark leaves the hashed extremes; witness row Stream/0/1 re-pinned), #316 (an opening stop's next waypoint; Random44/0/0 and /1 re-pinned) and #319 (tick-volume state, every existing pin kept). In the runner tooling bullet, "No versioned engine PF_API export ... changes" and "Plugin-free ledger identity bytes remain unchanged" read as release-wide; they now speak for #320 itself and for a strategy without the checked settings calls. The Report keys intro points at the report schema page. The terminal-quote bullet names the chart feed that PINEFORGE_RUN_REPORT_CHART_QUOTE points at, and two runner bullet headings are re-wrapped. Replaces text introduced by a80485c (this branch's first commit): the lead's "A run whose fills one of the Pine adapter changes below alters hashes to new values, and [#316] adds one placement field to the adapter's hashed state, for which two witnesses with byte-identical trades were re-pinned.", the Report keys intro and the terminal-quote harness clause; and text introduced by dbd17b3 (#320): "No versioned engine PF_API export, native C++ surface, script ABI epoch or engine behavior changes." and "Plugin-free ledger identity bytes remain unchanged". Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * docs: #315's range-end change folds less, not more The 1.1.0 lead said three changes "fold more state"; #315's range-end change instead stops folding a stream report's terminal re-mark into the hashed extremes. The sentence now says the three changes change what the hashes fold, and names Stream/0/1 as a re-pinned witness row without claiming it is #315's only one. Replaces text introduced by 66be240 (this branch's second commit): "Three changes also fold more state" and "re-pinning one witness row (`Stream/0/1`, whose recorded-row digest alone moves)". Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * docs: fold #325 and #327 into 1.1.0, add State hashes, amend the hash rule #325 (confirmed-bar streams compute what the batch computes) and #327 (docker/run_json.py --symbol-feeds) merged before the release notes, so their Unreleased bullets join the 1.1.0 section, rewritten and linked; no Unreleased heading stays. - CHANGELOG.md: the lead names the stream fix and, in the pairing sentence, codegen 1.1.0's request discovery (transpile_full()["requests"], codegen #164). #325's bullet says what a stream user sees; #327's bullet and its Report keys entry (applied_runtime.symbol_feeds, the --symbol-feeds: failure messages). A new State hashes section lists the four recipe additions since v1.0.1 (#315, #316, #319, #325; none removed, renamed or re-encoded; domain tags unchanged). #315's range-end equity-extreme change moves to the Pine adapter parity bullet as a behaviour fix. The #319 bullet named the broker-state hash; the change is in the native continuation hash, which the broker-state hash folds. The known-issue bullet now says it is fixed in 1.1.0 (#325). Migration gains a line on stream results and hashes. - README.md: the known issue is fixed in 1.1.0 (#325); the v1.1.0 Releases line gains the stream fix, request discovery and the harness's multi-symbol request.security feeds. Fact markers rendered from the facts export that maps releases[1.1.0] to pineforge-parity-baseline-20261004-engine-7b596622 (7,951 excellent / 38 strong of 7,989); the active scoreboard moves to the same baseline, here and in docs/pages/contributing-llm.md. - docs/pages/streaming.md: the known issue affected v1.0.0 and v1.0.1 and is fixed in 1.1.0. - docs/pages/public-contract.md: the state-hash rule, amended by the owner's ruling for 1.1.0. It covers the recipe only: a minor release may add a hashed field (domain tags unchanged, the added field changing no trade or report, disclosed under State hashes); removing, renaming or re-encoding a hashed field is a new epoch and a major release; behaviour changes follow the normal release and parity rules. The first uses are #315 and #316. The semver rule is unchanged. Replaces text introduced by 7b59662 (#325): CHANGELOG.md's "Confirmed-bar streams compute what the batch computes:" bullet, and the "Fixed on main (#325); included in the next release." lines of README.md and streaming.md; by 4f2a475 (#327): CHANGELOG.md's "Harness symbol feeds:" bullet; by d093560 (#290): public-contract.md's "State-hash values are stable within the epoch." and "a new recipe is a new epoch and a major release"; by a80485c (this branch's first commit): the "Known issue, as in v1.0.0 and v1.0.1" bullet, streaming.md's "(v1.0.0, v1.0.1, v1.1.0)", the #319 bullet's "A tick stream's broker-state hash folds the new accumulator state only where it adds information, so the existing tick, bar and batch hash pins hold.", the Report keys failure-output bullet and the v1.1.0 Releases line; by 66be240 and 83d64dc: the lead's state-hash sentences ("Three changes also change what the hashes fold"); and, as git attributes them through this branch's merge of main, by e59c09f: README.md's v1.1.0 Releases line and streaming.md's "(v1.0.0, v1.0.1, v1.1.0)". Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.
Summary
Non-Pine correctness fix: a bar built from ticks must equal the same bar built offline from the same prints.
3423.1860000000042instead of3423.186). Tick volume is now accumulated in integer units of the instrument's quantity step when that step is a power of ten and every print is on the grid, with compensated (Neumaier) summation otherwise. The sealed value is the nearest double of the exact decimal sum, so it equals parsing the exchange's decimal volume.Verification
pineforge/parity.🤖 Generated with Claude Code