Skip to content

feat(distribution): add Benerator 'cumulated' distribution (numeric +…#142

Open
ake2l wants to merge 2 commits into
developmentfrom
feat/cumulated-distribution
Open

feat(distribution): add Benerator 'cumulated' distribution (numeric +…#142
ake2l wants to merge 2 commits into
developmentfrom
feat/cumulated-distribution

Conversation

@ake2l

@ake2l ake2l commented Jun 27, 2026

Copy link
Copy Markdown
Member

… source reads)

Adds the 'cumulated' sampling distribution to close the largest Benerator migration gap (53 corpus uses), faithfully reproducing Benerator's CumulatedLong/DoubleGenerator (mean of 5 uniform draws -> symmetric bell, mean = midpoint).

Numeric generators:

  • IntegerGenerator/FloatGenerator gain distribution=NumberDistribution.CUMULATED. Default path stays uniform and byte-identical; a raw string is rejected.
  • FloatGenerator computes the span in Decimal so the top granularity bin remains reachable.

Source reads (CSV/JSON/memstore/DB):

  • 'cumulated' row selection on , and via a single DataSourceRegistry.get_distributed_data dispatch (shuffle vs bell-weighted index, with replacement, deterministic under ).
  • SourceDistribution enum validated once at the statement boundary (SourceDistribution.coerce); removes the None default state and the per-model distribution validators.

Shared cumulated_index sampler reused by the numeric generators and row selection. increment/step/random unchanged (sequential/uniform); unused Benerator distributions (shuffle/randomWalk/wedge/bitreverse) intentionally omitted - no corpus usage.

Tests: DSL models for all source paths (CSV + sqlite DB + generate + nestedKey, bell shape + seed determinism) and Python shape/guard tests for the numeric generators.

ake2l added 2 commits June 27, 2026 09:49
… source reads)

Adds the 'cumulated' sampling distribution to close the largest Benerator
migration gap (53 corpus uses), faithfully reproducing Benerator's
CumulatedLong/DoubleGenerator (mean of 5 uniform draws -> symmetric bell,
mean = midpoint).

Numeric generators:
- IntegerGenerator/FloatGenerator gain distribution=NumberDistribution.CUMULATED.
  Default path stays uniform and byte-identical; a raw string is rejected.
- FloatGenerator computes the span in Decimal so the top granularity bin
  remains reachable.

Source reads (CSV/JSON/memstore/DB):
- 'cumulated' row selection on <variable>, <generate> and <nestedKey> via a
  single DataSourceRegistry.get_distributed_data dispatch (shuffle vs
  bell-weighted index, with replacement, deterministic under <setup rngSeed>).
- SourceDistribution enum validated once at the statement boundary
  (SourceDistribution.coerce); removes the None default state and the
  per-model distribution validators.

Shared cumulated_index sampler reused by the numeric generators and row
selection. increment/step/random unchanged (sequential/uniform); unused
Benerator distributions (shuffle/randomWalk/wedge/bitreverse) intentionally
omitted - no corpus usage.

Tests: DSL models for all source paths (CSV + sqlite DB + generate +
nestedKey, bell shape + seed determinism) and Python shape/guard tests for
the numeric generators.
cyclic (wrap-around) is meaningless for with-replacement sampling, which never
runs out of rows. It was carried only for signature parity with the shuffle
sibling. get_distributed_data keeps cyclic for the shuffle branch and simply
does not pass it to the cumulated branch.

pagination|None is left as-is: a legitimate 'no pagination' optional and the
registry-wide convention, not a magic default alias.
@sonarqubecloud

sonarqubecloud Bot commented Jun 27, 2026

Copy link
Copy Markdown

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