Synthetic Dataset - Technical

Purpose

This page describes how Trade Control’s synthetic dataset is constructed for proof and reconciliation work.

It is intentionally technical: it documents the dataset generator as a controlled, repeatable test fixture used to validate accounting derivations (Cash Statement, Balance Sheet snapshots, and annual reconciliation views).

The generator is implemented as discrete stored procedures prefixed App.proc_DatasetSyntheticMIS_*, orchestrated by App.proc_DatasetSyntheticMIS.

Entry point procedures

Scenario runner (how proofs exercise the generator)

EXEC_DatasetSyntheticMIS.sql executes four scenarios designed to exercise the reconciliation across profit/loss and VAT modes:

Each scenario calls App.proc_DatasetSyntheticMIS with:

The scenario runner then records results from Cash.vwEquityReconciliationByYear for comparison.

Orchestration overview (module call order)

App.proc_DatasetSyntheticMIS runs the following steps in order.

0) Template selection and VAT inference

1) Shared lookup table: #DatasetCodes

A temp table #DatasetCodes is created once per run and used by all nested procedures to share generated codes (Subjects, Projects, etc.) deterministically.

2) Bootstrap (mandatory)

Responsibilities (high level):

This step is what makes runs repeatable: every scenario begins from the same baseline.

3) Project-side trading lifecycle (conditional)

Executed when @EnableProjects = 1:

These procedures create the trading activity that drives profit/loss and therefore the annual reconciliation.

4) Payables side (conditional)

Executed when @EnablePayables = 1:

These procedures generate operating cash movements and costs required for non-trivial Cash Statement coverage.

5) Company assets (conditional)

Executed when @IsCompany = 1 and @EnableAssets = 1:

This provides asset-state behavior for balance sheet snapshotting and capital-related flows.

6) VAT (conditional)

Executed when @IsVatRegistered = 1 and @EnableTax = 1:

This enables VAT-on scenarios and is part of proving VAT does not break the annual bridge (penny-level rounding only).

7) Transfers / current-to-reserve sweep (conditional)

Executed when @EnableTransfers = 1:

This introduces non-trade cash movements (sweeps) so bank/cash behavior is not trivial.

8) Corporation tax on profit (conditional)

Executed when @IsCompany = 1 and @EnableTax = 1:

This provides corp tax behavior required to prove:

9) Final rebuild (mandatory)

This ensures downstream reporting surfaces (views/materializations that depend on rebuild logic) are coherent for the scenario outputs and proof script.

Relationship to the proof paper

The proof paper /technical/cash-statement-proof references:

This synthetic dataset exists specifically to provide controlled coverage of the reconciliation under:

The dataset can then be used as a reliable foundation for tutorials and guides.