QuantCalc QuantCalc Federal tax engine docs

Federal tax / Verification

How the federal tax engine is verified

What is tested, against what, and where the testing stops.

Every step has a test

Each calculation step names the tests that prove it (on the calculation order page); the documentation gate fails when a step has no test, or names a test that does not exist. The composition's tests are hand-worked returns on the 2026 parameters (the result and every Form 1040 line), every sign combination of the capital-gain netting, every branch of the senior deduction, and four Form 1040 identities on a random corpus (taxable income, line 7a, total income, total tax).

StepTestsSourcesBasis
One field table: keys, types, limits and unknown keys30convention
Value checks and the return's facts20convention
The year's parameters10convention
The response: result, Form 1040 lines and sources30convention
The state API's computeFederal40convention
Tax-exempt interest16official
IRA distributions and Roth conversions25official
Pensions and annuities15official
Social Security benefits15official
Taxable Social Security (the Pub 915 worksheet)46official
Net short-term gain or loss15official
Net long-term gain or loss15official
Combined net gain or loss15official
Line 7a: a net loss enters as zero25official
Other ordinary income15official
Total income15official
Adjusted gross income25official
Standard deduction and the ยง63(f) aged amount26official
The senior deduction (Schedule 1-A)27official
Additional deductions on line 13b14official
Total deductions15official
Taxable income25official
Tax: the brackets and the capital-gains worksheet49official
The 10% additional tax on early distributions35official
Net investment income tax36official
Other taxes14official
Total tax24official

Every line and branch is executed

The coverage gate builds the engine with coverage instrumentation, runs its tests and fails below these measured floors:

FileLinesBranchesLine / branch
federal_tax.c96 of 9630 of 30100% / 100%
federal_tax_api_meta.c198 of 19855 of 55100% / 100%
federal_tax_json.c295 of 295186 of 186100% / 100%
state_tax_federal.c144 of 144102 of 102100% / 100%
tax_calculator.c178 of 17884 of 84100% / 100%

No change without a record

The engine was extracted from the planner without changing a single result: a golden corpus recorded from the planner before the extraction (every federal caller: the withdrawal cost and optimiser, every withdrawal policy, the tax-aware simulation's persona panel, full simulation and ACA-bridge responses) is compared bit for bit on every change. A change that moves a result must carry a new engine version, a record in the defects ledger and a re-recorded corpus.

The API is the planner's engine

The API's 2026 parameters are held byte-identical to the planner's 2026 year for every filing status and age pair, and the state API's computeFederal is held to the planner: for a single filer the federal tax and the state tax it returns equal the planner's in every jurisdiction. The published schema, rules and worked examples are regenerated from the code and checked on a seeded corpus of a few thousand requests: every accepted request and every response validates, and every refusal is a documented message.

Sources are re-checked weekly

Every passage on the sources page is re-fetched weekly from its official source; the job fails when a passage is no longer there, and its date on these pages moves only when the passage was found again.

Where it stops

The engine computes the parts of a return listed on the overview and nothing else; what it does not model is listed there too, and the API refuses a request that would need it. Line numbers follow the 2025 forms until the 2026 forms are published.