Skip to content

feat(profile): release a tracked column's history count by count - #1183

Merged
fas89 merged 22 commits into
mainfrom
feat/profile-cell-release-3
Dec 4, 2026
Merged

fas89 merged 22 commits into
mainfrom
feat/profile-cell-release-3

Conversation

@fas89

@fas89 fas89 commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

What

fluid profile now releases a tracked column's initial and transitions count by count when its version table holds a small count, instead of withholding both members whole.

  • A table every count of which passes is published whole, as before, unless the release could not tell it from one that fails (below).
  • Any other is released one count at a time, in a fixed order: each level's first versions, each change between two levels (each group's size told beside its first published cell), and each member's sampleSize band.
  • Each decision reads only a model of what a reader holds (what the document already publishes, the counts released so far, and how the table fails the rule) and the count's own value. The value decides alone only where every value the rule leaves unprotected could be published without pinning a count: each told interval the model allows is tried. Otherwise the count is withheld whatever it holds. So a withheld count is one the rule protects, or one whose withholding says nothing, and every table of the model takes the same decisions. A reader who knows how the release works learns no more from a withheld count than that the rule protects it.
  • Whether a column is withheld whole is read from the model alone, never from whether the records pass: where the tables of the model that fail the rule would pin a count it protects, every table of the model is withheld whole, the one that passes too.
  • The model holds of a withheld level cell only that one of the withheld cells is one the rule protects, never which (a union, one model for each). The entities are held as far as the history's versionsPerEntity publishes them.
  • Where no model is built (a level cell withheld beside another statistic between the column's edges, an entity past the versions versionsPerEntity bounds, or a model past MOST_CELLS), or where the withheld level cells hold none the rule protects, the column is withheld whole whether its table passes or not.
  • The model's size and the budget of its audits are read from what the document publishes, never from the records: each integer program is weighted by the size of its model at the longest history versionsPerEntity publishes, within a fixed budget (MOST_SOLVES programs, MOST_WORK units). Where versionsPerEntity bounds no history (its top bin coded to the ladder's end, or withheld), the public cap MOST_VERSIONS = 20 bounds it, and a column with an entity past 20 versions is withheld whole. 20 is the top finite edge of the ladder of versionsPerEntity, so a release that tells a reader no entity holds more pins no bin of it; a test holds the cap at or above that edge.
  • New fluid_build/profiler/cell_suppression.py: the model (linear facts over nonnegative whole-number cells), the exact audit (scipy milp, HiGHS) and the release. The version table's model follows each entity's versions position by position, so it holds no pair that no entity makes.
  • A column a declared endMarker names is now published: no version follows the marked level, so its row of changes is written as the zeros the contract states. Records that break the marker withhold the column whole. A marker value is matched to a level by its text, as a number or as a boolean; one that matches no level, and a currentFlag, still withhold the column whole with a note.
  • scipy>=1.10 joins the profile extra (never the base install); it is imported only when a release runs.

Scope

Levels are never merged.

Borrow before build

Checked locally:

  • forge-cli: profiler/disclosure.py (suppress_secondary withholds every group beside a withheld one; suppress_differencing; pinned_children_cells), flux-stats edge_counts.check_edge_counts (cell-level checks within one column's statistics). Nothing that releases counts across linked tables with an audit.
  • Dependencies: numpy, duckdb, flux-stats. No LP solver in the base or the profile extra.

Searched:

  • "python library secondary cell suppression frequency table linear programming audit open source": sdcTable and GaussSuppression (R), ACRO (Python output checking, no secondary suppression), de Waal and Coutinho (2020) on LP disclosure auditing.
  • "site:github.com complementary cell suppression python milp HiGHS": HiGHS repositories only; no Python cell-suppression engine.
  • "scipy.optimize.milp integrality HiGHS mip_rel_gap documentation": milp takes integrality, and mip_rel_gap through options.
  • "simulatable auditing sum queries implementation open source": the paper and later work only, no code.
  • "site:github.com query auditing statistical database denial simulatable": no repositories; Lu, Vaidya, Atluri and Li (2014) note the utility cost of simulatable denial.
  • "GaussSuppression singleton problem interval protection upper protection level frequency table": SuppressSmallCounts(protectionIntervals=), IntervalLimits, protection levels after the SDC Handbook (2nd ed., ch. 4.2.2).
  • Fetched: GaussSuppression NEWS (CRAN mirror): interval protection stable since 1.3.4, intervals by LP (lpPackage: lpSolve or highs).
  • "statistical disclosure control top-coding public threshold frequency table SDC handbook": the SDC Handbook (2nd ed., 2025) and the ESSnet handbook on top and bottom coding at a public threshold. https://research.cbs.nl/casc/Handbook.htm
  • "differential privacy contribution bound cap rows per user public clamp library": per-entity contribution bounds (Wilson et al. 2019; Google's library; DPolicy 2025).

Prior art found:

Verdict: adapt, no dependency beyond scipy. Reuse strategy: adapt the pattern (simulatable auditing's decision rule; GaussSuppression's idea that a withheld count is safe only when what is published does not determine it, cited in the module docstring) and depend on scipy for the integer programs.
Rationale: no Python engine exists; the R tools are GPL or EUPL or need R, piargus needs a Java binary, and no suppression tool models a reader who knows how the suppression decides. The code copies nothing from any of them.

Tests

  • tests/profiler/test_history_cell_suppression.py: the module's release over every 2 by 2 table with cells up to 5, its margins known, under two rules: grouped by document, a reader who knows the release pins no protected cell the margins alone do not. A gym and a library through the profiler, with the test's own reader (its own integer programs over the document). A library whose CLOSED ends a membership publishes the CLOSED row as zeros; records that break the marker, and a currentFlag, withhold whole.
  • tests/profiler/test_history_column_oracle.py: every world of each universe profiled, grouped by document; a document fails when its worlds pin a protected count, or bound one below minimumCell, that its baseline does not. Fifteen universes (two and three levels, chains up to three, nullable and required columns, an endMarker under several spellings, a currentFlag, counts that round to zero, rows outside the history, a second tracked column beside two and three levels). Planted mutants (per cell, no walks, a small band, no null gate, a trusted required column, a joint check on the marker, an exempt structural zero, a spelled marker) each pin a count, so every check is live. Each mutant's documents are read beside the counts that mutant would write.
  • Pass/fail pair tests: two tables with the same document, one passing and one failing, get the same statuses on the modelled path and on the path with no model.
  • Failing first:
    • The oracle with each mutant read beside its own counts, run on the release before the whole-withhold change: the endMarker universe fails with 30 pinned counts (a level's changes out, a change between two levels, a level's first versions).
    • test_whether_a_column_is_withheld_whole_does_not_tell_a_passing_table_from_a_failing_one: before, the passing table was published whole and the failing one withheld.
    • test_a_reader_knows_the_entities_only_as_far_as_the_document_publishes_them: before, the reader held an entity band the document does not publish.
    • test_which_withheld_level_cell_is_the_small_one_decides_nothing: before, which withheld level cell was small changed a status.
    • test_a_column_too_large_to_model_is_withheld_whole_whether_its_table_passes_or_not: before, a passing table past MOST_CELLS was published whole.
    • test_withheld_level_cells_none_of_which_the_rule_protects_withhold_the_column_whole: before, the column was released against a model that did not hold its records.
    • test_a_solve_of_a_larger_model_takes_more_of_the_budget: before, a program over a large model cost as much as one over a small one.
    • test_two_tables_a_document_tells_alike_are_decided_alike_whatever_their_longest_walk: before, the size gate and the weight read the records' longest history.
    • test_a_walk_past_the_bound_withholds_the_table_whole_and_the_public_cap_bounds_the_rest: before, a column whose versionsPerEntity bounds no history was withheld whole.
    • test_a_release_with_no_model_of_the_table_withholds_every_item: before, it raised IndexError.
  • test_one_entity_at_twenty_versions_or_twenty_one_is_what_the_cap_decides: two tables alike but for one entity's last version; at 20 versions released, at 21 withheld whole.
  • The oracle runs a universe in the default lane with the cap at 2, below its chains of three, and a planted mutant that credits the release's readers with a tighter cap than it enforces pins counts in the endMarker universe.
  • A followed key's property test (random draws, three to five keys) runs on the oracle job with every audit at its full budget; a sibling publishes its history whole in the default lane. A planted leak (per-cell primary suppression only) fails the sibling and every draw.

The endMarker rule

Before: a tracked column a declared endMarker names was withheld whole, with a note. Now: no version follows the marked level, so the column is released, its row of changes out of that level published as the zeros the contract states; records that break the marker still withhold it whole. A currentFlag, and a marker value that matches no level, still withhold it whole with a note.

What a reader still learns

  • A reader who knows the rule learns that a count withheld for its own value is one the rule protects, and a column withheld whole after a passing certificate tells a reader that some count of the table fails, which can bound a count where only one count can fail. Primary suppression tells as much.

  • A column is withheld whole when a reader of what the release fixes already bounds a count that a reader of the document alone could not.

  • A table that fails the rule runs more integer programs than one that passes, so near the budget it is withheld whole sooner. A failing table already shows as released count by count or withheld, never as whole, so this tells nothing more.

  • A released column tells a reader that no entity holds more versions than versionsPerEntity bounds, or than 20 where it bounds none (also where versionsPerEntity is withheld). That is a zero past a public bound, like the outer edge a coded histogram writes, not a cell the rule protects.

  • How long the audits run is the records': the budget is a count of weighted programs, but the release's own model follows each history to its end.

  • The budget is a loss of detail, never of protection. A column whose audits use it up before the first count is withheld whole. Time per followed key, at the budget (seconds, one key column, most of it in the solver): 4 keys of 300 members 29, 6 of 600 50, 8 of 1,000 46, 10 of 2,000 48, 12 of 1,500 51 (272 at 10 of 2,000 before the weights).

Utility where versionsPerEntity bounds no history

Geometric histories (each further version with probability p), the release run as the profiler runs it, minimumCell 10, zeros disclosive. Withholding whole there is what this change replaces; a cap at the most versions the model's cells allow was measured beside the one chosen.

Levels Entities, p Table Withheld whole Cap at the most the cells allow Cap 20
2 200, 0.6 passes withheld published whole (33 programs) published whole (33)
3 200, 0.6 passes withheld published whole (79) published whole (79)
4 1,000, 0.5 passes withheld published whole (124) published whole (124)
6 1,000, 0.5 passes withheld budget used up, withheld published whole (261)
10 1,000, 0.5 fails withheld budget used up, withheld budget used up, withheld
2 40, 0.5 fails withheld 0 of 6 counts 1 of 6 counts
3 60, 0.5 fails withheld budget used up, withheld 1 of 11 counts
4 80, 0.5 fails withheld budget used up, withheld 0 of 18 counts
6 300, 0.5 fails withheld not run 0 of 38 counts

On the oracle's universes, withholding whole there left five universes below their publish floors (one published 30 of a floor of 40, and four planted mutants gave nothing away); with the cap of 20 every floor holds.

Where versionsPerEntity publishes a bound (minimumCell 10, geometric versions): 200 entities, p 0.6 (largest 6) and 1,000, p 0.5 (largest 11) and 5,000, p 0.6 (largest 12) code their tail and now take the cap; 100,000, p 0.5 (largest 17) bounds at 19 and publishes; 95 entities as 50, 30, 15 bound at 4 and publish; 89 as 50, 30, 9 code their tail and take the cap.

Gates

  • ruff check and black --check on fluid_build/profiler and tests/profiler: clean.

  • tests/profiler and tests/perf/test_startup_budget.py (-n 3): 3067 passed, 73 skipped. fluid --help imports neither scipy nor the new module.

  • The exhaustive history oracle in full (FLUID_PROFILE_ORACLE=full, -n 3) on a loaded machine: 15 of 16 universes pass with no pinned count, and every publish floor holds. f2 ran past its 3600 s mark there, so it runs in this pull request's oracle job. Under the old behaviour (withheld whole wherever versionsPerEntity bounds no history) f2 took 514 s; its time on a clean runner under the cap is in the oracle job below. Floors and mutants:

    Universe Worlds Publish (floor) Mutants pin
    d1 171 3 (0) per cell 160
    d1, cap at 2 171 3 (0) none planted
    d2 280 19 (15) per cell 273, small band 34
    f1 1550 46 (40) no walks 266
    f3 7272 18 (5) none planted
    f4 2184 19 no null gate 420
    f5 2820 192 (100) none planted
    f6 2184 19 trusted required 420
    f7 1548 498 (1) none planted
    m1 407 56 joint on marker 47
    m2 407 31 (0) exempt structural 12, credited cap 907
    m3 407 0 joint on marker 47
    m4 407 56 spelled marker 47
    o1 1284 55 (40) none planted
    z1 1596 381 (300) none planted
  • The followed-key oracle and the draws run in this pull request's oracle job; the planted leak (per-cell primary suppression only) fails the sibling and all eight draws.

  • A diff review and an independent review of the release's disclosure (the cap, the gate on a history past it, the empty-state guard and the oracle changes): no open finding above low. The low ones are fixed or listed above.

  • Defect scan (diff mode, one round) and a security review of the release: no open finding above low; the three low ones (an unbounded program read by its status code, a solver failure mid-release caught like a budget run out, and a missing solver found before any table is read) follow in the next pull request.

  • ripwire --quality-delta on main plus this diff: the gating rows are dead code and churn in files this change does not touch, plus two oracle helpers that grew (_Audit, _run); the new release code's complexity is in release, _small and every_value_safe, each one decision procedure.

  • Public text checks on the diff, the commit message and this body: clean.

Oracle job

The audit runs for every world the exhaustive oracles profile, so their universes take longer than on main and one job no longer fits in two hours. profile-oracle.yml now runs six shards (fail-fast: false, -n 4 -v --durations=0). tests/profiler/oracle_shards.txt lists each shard's tests, longest first, and a first step diffs that list against --collect-only so a universe added or renamed without a shard fails the job. The four followed-key universes o1 to o4 run on a shard each, with marks of 14400 s for now.

Borrow before build: pytest-split 0.11.0 (MIT, https://github.com/jerry-git/pytest-split) and pytest-balance were checked. Both split by stored durations, none existed for these tests, and a split by test count is blind to a test of two and a half hours. Explicit lists balanced by the measured durations below, plus the cover check.

Shard times at 37845ac (run 47380513173, all green):

Shard Tests Job Pytest
1 o4, m4, z1, m2 160 min 9531 s
2 o3, f7, m1, m3, column o1 55 min 3257 s
3 o2, d2, d1, o8, d1 under a cap, o6 94 min 5580 s
4 o1, o7, f1, f4 37 min 2182 s
5 o5, f2, f3, f6, o0, f5 48 min 2831 s
6 the eight followed-key draws 24 min 1389 s

The followed-key universes, main (6d0e7ba, local, one test at a time, one thread) beside this branch (CI runner, the shard above):

Universe Main This branch
o1 143 s 2180 s
o2 199 s 5538 s
o3 245 s 3043 s
o4 355 s 9528 s

The two columns come from different machines; on the same machine o1 went from 143 s to 1748 s (12x). Other pairs measured that way: f1 100 s to 543 s (5.4x), m1 30 s to 223 s (7.4x), d2 32 s to 124 s (3.9x), f4 178 s to 344 s (1.9x). f2 took 2372 s on its shard. The audit's cost per profile is the next step for these universes; once it drops, each mark goes to 1.5 times its new measured time.

The rest of CI beside the last green run on main (528822e): Test 3.10 21.9 min (main 21.9), 3.11 17.7 (17.5), 3.12 19.4 (19.2), 3.13 24.7 (19.1), 3.14 16.3 (15.4); Coverage & Audit 26.3 (23.4); the differential privacy job 21.0 (14.4). Per-test times were compared from both runs' junit reports, and the tests that grew by more than a few seconds now run their full audit only in the oracle job.

A tracked column whose version table holds a small count no longer has
its initial and transitions withheld whole. A table every count of which
passes is still published whole. Any other is released one count at a
time in a fixed order: each level's first versions, each change between
two levels, and each member's sampleSize band.

Each decision reads only a model of what a reader holds (what the
document already publishes, the counts released so far, and that the
table fails: every table of the model that fails, a union of models)
and the count's own value, and the value decides alone only where every
value the rule leaves unprotected could be published. So a withheld
count is one the rule protects, or one withheld whatever it holds, and
every table of the model takes the same decisions: a reader who knows
how the release works learns no more than that. No publication lets a
reader of the published counts alone bound a count below minimumCell
where it could not before.

The model is solved exactly as integer programs with scipy's milp
(HiGHS), in the profile extra and imported only when a release runs. The
moves out of a declared endMarker level are published as the zeros the
contract states.

The exhaustive oracle also fails a protected count that a reader of the
baseline document and the members' published counts can bound below
minimumCell, and a planted mutant shows the check is live.

A count the rule protects includes a positive count that rounds to zero.
The audits before the first count and the release share one budget of
integer programs and stop at it, each program has a node limit, and a
table whose audit runs out is withheld whole. The reader of the
published counts is modelled from what the document says; a column with
another statistic between its edges is withheld whole when a level cell
of it is withheld. A level's records, with the rows outside the history,
are counts the release keeps too. Two oracle universes cover counts that
round to zero and rows outside the history, and a third covers a
second tracked column beside a column of three levels.

Whether a table is published whole does not tell one that passes from
one that fails: where the tables of the model that fail pin a count the
rule protects, every table of the model is withheld whole, read from
the model alone. The reader's model holds the entities only as far as
the history's versionsPerEntity publishes them. The oracle reads each
planted mutant's documents beside the counts that mutant would write.

The model holds of a withheld level cell only that one of the withheld
cells is one the rule protects, never which. Where no model can be
built, or the withheld level cells hold none the rule protects, the
column is withheld whole whether its table passes or not.

The budget weighs each integer program by the size of its model, read
from the longest history versionsPerEntity publishes, never from the
records. Where versionsPerEntity bounds no history (its top bin coded
to the ladder's end, or withheld), the release holds each entity to at
most 20 versions, a public cap, and a column with an entity past it is
withheld whole. A release with no model of the table withholds every
count.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
@github-actions github-actions Bot added ci Continuous integration and automation changes tests Test coverage or test infrastructure changes labels Dec 4, 2026
Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
@github-actions github-actions Bot added the needs-docs Pull request needs a linked docs update or justification label Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

📄 Documentation Reminder

This PR appears to be missing a documentation reference. Our docs live in a separate repo.

Please update the PR description with one of:

  • Link a docs PR — check the "Docs PR linked" box and paste the URL
  • Mark as no docs needed — check "No docs needed" with a justification
  • Acknowledge docs TODO — check "Docs TODO" and create the docs PR before merge

See the Contributing Guide for details.

Comment thread fluid_build/profiler/history.py Fixed
fas89 added 20 commits December 4, 2026 07:21
The tracked-column release adds integer-program audits and the
default universes of its oracle to tests/profiler, which this job runs
serially; it stopped at its 25-minute limit with a fifth of the tests
left.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…re read

The library's tracked column fails the rule, so each of its profiles
read the audits' whole budget before withholding it whole, and the
reference tests profile it hundreds of times. They now stop the audits
at once, with the same outcome. Also drop a list the version model no
longer reads, and spell a chained comparison in a test as two.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…all exponent

Reading 1e12345678 exactly built an integer of twelve million digits, so
a level spelled that way never returned. A number is now a decimal with
an exponent of at most 64, or a ratio of two integers, in at most 64
characters; anything else is no number.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…ers whole

Pin the release's two ways out before the first count through the
profiler: an integer program that ends unsolved, and audits that use up
their budget, each withhold initial and transitions whole on a table
that would otherwise publish whole.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…wn job

Each of these tests reads a whole budget of integer programs. The
default test run skips them; the profiler's CI job sets
FLUID_PROFILE_AUDITS=1 and the oracle job's full run counts too, so they
still run on every pull request that touches the profiler.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
The secret scan read the spelled number as a high-entropy string.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…ease-3

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
The single-branch and four-row universes of the followed-key oracle and
two history-member tests each read a whole audit budget; they now run in
the profiler's own job. The reference tests withhold the library's
tracked column without its audits, as the audits do.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
Tests that the history release slowed by more than a few seconds run in
the profiler's own job; the policy and relationship tests withhold the
tracked column without its audits, as the audits do; and the profiler's
job runs a module to a worker, one per core.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…ease-3

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
… audits in the profiler's job

The default test run still withholds the tracked column without its
audits there; the profiler's own job now runs the release in full. The
reference tests keep the shortcut in every job, as each profiles the
library well over a hundred times; a followed key's history is released
through its audits in the follow tests and the followed-key oracle.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…ase in full

The policy and relationship modules withhold the tracked column without
its audits again in every job; one test in each, run in the profiler's
own job, puts the release back and checks that the column went through
it: a raised minimumCell beside a followed key's history, and children
counted per entity beside the stations' tracked columns.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
The five universes the default run used to hold (two of the followed
key, three of the tracked column) run with the full oracle, which runs
every universe on each pull request that touches the profiler. The
profiler's job hands out its tests one at a time, and the policy and
relationship tests run the release in full there again. A new push to a
pull request cancels the oracle run on its old head.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
One test in each runs the release in full and checks that the column
went through it; the rest withhold the tracked column without its
audits, as the audits do.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
The integer-program audit makes each oracle universe several times slower,
and the full set no longer fits one runner's two hours. Each shard now runs
on its own runner with four workers, balanced by the tests' own timeout
marks, and reports every test's time. A first step checks that
tests/profiler/oracle_shards.txt names each collected oracle test once, so
a new universe fails the job until it is placed in a shard.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…llowed-key universes

The four-shard run measured each oracle test, and the followed-key
universes o1 to o4 each passed their own timeout mark. Each now runs on a
runner of its own under a four-hour mark, with light tests beside it; the
column universes and the seeded draws fill the other two shards. Every
shard lists its longest test first. f2's mark rises to 4200 s and o5's to
2700 s, half again above their measured times.

Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
@fas89
fas89 marked this pull request as ready for review December 4, 2026 19:32
@fas89
fas89 merged commit d4ff38f into main Dec 4, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous integration and automation changes needs-docs Pull request needs a linked docs update or justification tests Test coverage or test infrastructure changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant