Evidence, not assurance

How we
test it

£12 is a low price for software whose output goes on a tax return, and "trust us" is not an answer to that. So here is what is actually tested, what is deliberately not, and how you can check the claim yourself.

In numbers

27

HS284 assertions

Against HMRC's own published worked examples. Each names its example and quotes the figure it asserts.

325

Tests on every build

The whole suite runs on every commit. A red engine lane blocks the merge.

3

Matching rules pinned

Same-day, 30-day and Section 104 — each with its boundaries tested on both sides.

0

Floating-point money

Every figure is an exact decimal from end to end. Money is never a binary float, anywhere.

What HS284 is

HS284 is HMRC's own helpsheet, "Shares and Capital Gains Tax". It explains the pooling and matching rules and works three examples all the way through to a chargeable gain — with figures. That makes it the closest thing to an official answer key that exists for this calculation, and it is what GainPool is tested against.

The distinction we insist on

HS284's three examples give figures. The Section 104 arithmetic, the same-day rule and the ordering of the three rules are stated as a method, not tabulated. Those are two different kinds of evidence and we do not blur them:

  • Where HMRC publishes a number, we assert that number exactly, and the test's comment quotes it.
  • Where HMRC states a method, we assert hand-worked fixtures derived strictly from that method, with the full derivation written above the test so a reviewer can re-derive it instead of trusting it.

A test that says "HMRC's figure" when it means "our arithmetic" is worth less than no claim at all.

Example 3, worked end to end

HMRC's Example 3 — two disposals from one pool — is asserted in full, including the part that catches people out.

Apr 2014 buy 1,000 @ 400p = £4,000 + £150 costs → pool 1,500 / £6,280 Sep 2017 buy 500 @ 410p = £2,050 + £80 costs May 2022 sell 700 @ 480p → chargeable gain £329 (HMRC's figure) Feb 2023 sell 400 @ 520p → chargeable gain £300 (HMRC's figure) carried forward 400 shares

On rounding, which is the subtle part: the engine keeps full precision inside the pool and does not round to the penny between disposals, so its carried-forward cost differs slightly from HMRC's rounded illustration. Both chargeable gains still land exactly on HMRC's published figures once rounded to whole pounds for the return — and the test pins both the exact arithmetic and the rounded agreement, because that is the property that actually matters.

You can run this example yourself, right now, in the Section 104 calculator — it runs the same engine, in your browser.

What the 325 tests cover

SuiteTestsWhat it holds
Engine unit tests173Every rule and boundary, including the matching order itself
hs284_pool27HMRC's published worked examples
gainpool-pack19The computation pack: pagination that never breaks mid-record
platform_detection17Which broker a file is, from its columns alone
fixture_regressions15Real file shapes that once broke something
trading212_import13The one importer validated against a real export
wizard_flow11The mapping wizard's route, end to end
sa108_boxes9The numbers that go in each box of the return
split_rate_year_2024_259The 30 October 2024 rate change, mid-year
diagnostic_leaks8That an error message cannot leak your holdings
import_remedies8That a failure tells you what to do about it
provenance5That every figure can name the file it came from
Others11CLI, profile preference, README/profile agreement, doc-tests
Total325Run on every commit, on Linux, macOS and Windows

Counted from the suite on 31 July 2026. If these numbers are stale, the suite is right and this page is wrong — tell us.

What is deliberately not tested, because it is not in scope

The honest half of this page. GainPool covers GBP-denominated shares, ETFs and securities, with foreign-currency trades converted at the rate in your export. It does not compute, and does not pretend to:

  • Options, futures, CFDs and spread bets
  • Property, or anything reported outside the listed-securities section of the SA108
  • Business Asset Disposal Relief, Investors' Relief, EIS/SEIS deferral, and other reliefs
  • Excess reportable income on offshore funds — planned, not present
  • Trusts, estates, partnerships, and non-resident or split-year cases

The same list is inside the application, on screen, before any figures are shown — not buried in a licence agreement afterwards.

Check it yourself

Nothing here asks to be taken on faith. The engine is a Rust library with no GUI dependencies, so the tax logic can be exercised without installing an application:

cargo test -p gainpool-core --test hs284_pool # the HMRC examples cargo test # all 325

Every assertion in that first suite carries a comment naming its HS284 example and quoting the figure, so you can put the helpsheet beside the output and match them line by line.

Found something wrong? A demonstrated error in the tax arithmetic is the most valuable thing anyone can send us. hello@longstopsoftware.com — a person reads it, and a fix ships with a test that pins it.

The desktop app

Every figure,
with its working attached.

GainPool exports a computation pack that shows how each number was reached — the document you would want if anyone ever asked.

See what GainPool does