Skip to content

Commit bca5a47

Browse files
luisleo526claude
andcommitted
tests: pin the measured adapter and host layout after the long-tick margin state
Expectation corrected: sizeof(PineExecutionAdapter) 90360 -> 90392, sizeof(PineStrategyHost) 109264 -> 109296, pine_view_ 89080 -> 89112, retired_row_scratch_ 89088 -> 89120 and staged_scopes_ 89760 -> 89792, because this branch adds four members (a bool, an int64, an int32 and a double) to PineExecutionAdapter ahead of the pinned members, and the strategy host contains the adapter by value. Every number is the value that the probe's measure mode printed on a Linux x86_64 build of this branch with GNU libstdc++; the same build of main prints the old values. On both builds sizeof(BacktestEngine) is 6408, BacktestEngine::runtime_contexts_ is at 6400 and PineStrategyHost::adapter_ is at 6440, so the engine layout and its stamp do not change. Every other pin is unchanged. Co-Authored-By: Claude Fable 5.2 <[email protected]>
1 parent 102ffb6 commit bca5a47

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎tests/test_abi_layout_probe.cpp‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,14 @@ using Scratch = std::remove_reference_t<
5858
// The ABI pins apply to Linux x86_64 builds that use GNU libstdc++.
5959
// PlacementTable members added in #756 grow both enclosing layouts by 32 bytes.
6060
// The fill-time peak of the drawdown rule (one double) grows both by 8 bytes.
61+
// The long-tick margin state of a full-margin long (four adapter members) added in #812 grows both layouts by 32 bytes.
6162
static_assert(sizeof(Scratch) == 672, "RetiredRowScratch size changed");
62-
static_assert(sizeof(Adapter) == 90360, "PineExecutionAdapter size changed");
63+
static_assert(sizeof(Adapter) == 90392, "PineExecutionAdapter size changed");
6364
#ifndef PINEFORGE_RUNTIME_LAYOUT_MEASURE_ONLY
6465
// Linux x86_64 GNU libstdc++ compiler diagnostics agree in Release and Debug
6566
// on the integrated tree. Measurement mode skips this pin and is never a
6667
// passing ABI gate.
67-
static_assert(sizeof(Host) == 109264, "PineStrategyHost size changed; measure and pin the final layout");
68+
static_assert(sizeof(Host) == 109296, "PineStrategyHost size changed; measure and pin the final layout");
6869
#endif
6970
static_assert(PF_STREAM_ENGINE_LAYOUT_VERSION == 4u, "runtime contexts require layout stamp 4");
7071
static_assert(!HasRosterRoots<Scratch>::value,
@@ -134,9 +135,9 @@ int main() {
134135
#if defined(__linux__) && defined(__x86_64__) && defined(__GLIBCXX__)
135136
bool pins_hold = true;
136137
pins_hold &= pin("sizeof RetiredRowScratch", sizeof(Scratch), 672);
137-
pins_hold &= pin("sizeof PineExecutionAdapter", sizeof(Adapter), 90360);
138+
pins_hold &= pin("sizeof PineExecutionAdapter", sizeof(Adapter), 90392);
138139
#ifndef PINEFORGE_RUNTIME_LAYOUT_MEASURE_ONLY
139-
pins_hold &= pin("sizeof PineStrategyHost", sizeof(Host), 109264);
140+
pins_hold &= pin("sizeof PineStrategyHost", sizeof(Host), 109296);
140141
#else
141142
// A successful measurement command is never a successful layout test.
142143
pins_hold = false;
@@ -198,11 +199,11 @@ int main() {
198199
pins_hold &= pin("RetiredRowScratch::origin_fronts_pinned",
199200
member_offset(adapter.*access(RetiredScratch{}), &Scratch::origin_fronts_pinned), 664);
200201
pins_hold &= pin("PineExecutionAdapter::pine_view_",
201-
member_offset(adapter, access(BeforeScratch{})), 89080);
202+
member_offset(adapter, access(BeforeScratch{})), 89112);
202203
pins_hold &= pin("PineExecutionAdapter::retired_row_scratch_",
203-
member_offset(adapter, access(RetiredScratch{})), 89088);
204+
member_offset(adapter, access(RetiredScratch{})), 89120);
204205
pins_hold &= pin("PineExecutionAdapter::staged_scopes_",
205-
member_offset(adapter, access(AfterScratch{})), 89760);
206+
member_offset(adapter, access(AfterScratch{})), 89792);
206207
pins_hold &= pin("PineStrategyHost::adapter_",
207208
member_offset(host, access(HostAdapter{})), 6440);
208209
return pins_hold ? 0 : 1;

0 commit comments

Comments
 (0)