The counters and positions of a chain of `n` drafts made after a window at `p` with `a` accepted (draft()), or for draft_first (cell0 = p - 1, a = 0), checked against the next window at `p_next`.
| 32 | // The counters and positions of a chain of `n` drafts made after a window at `p` with `a` accepted (draft()), or for |
| 33 | // draft_first (cell0 = p - 1, a = 0), checked against the next window at `p_next`. |
| 34 | void check_chain(int64_t p, int a, int n, int64_t p_next) { |
| 35 | for (int j = 0; j < n; ++j) { |
| 36 | const int64_t cell = coupled_draft_cell(p, a, j); |
| 37 | // mtp.hpp: cell c predicts the token at c + 2; the next window's row j + 1 holds position p_next + j + 1 |
| 38 | check(cell + 2 == p_next + j + 1, "draft position = its row in the next window", cell + 2, p_next + j + 1); |
| 39 | // row j + 1 is kept iff it equals row j's pick, drawn at p_next + j |
| 40 | check(coupled_draft_counter(cell) == verify_row_counter(p_next, j), "draft counter = verifying row's counter", |
| 41 | (long long) coupled_draft_counter(cell), (long long) verify_row_counter(p_next, j)); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | // The device ring for one chain: base staged at [cap - h, cap) by the host, draft i at cap + i; draft j's window is |
| 46 | // [coupled_hist_start(cap, j, h), + h). Compared with penalty_rows over (consumed, [next, drafts...]). |
no test coverage detected