Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d757380
Apply the Marriage Allowance rate test at the statutory limits
MaxGhenis Nov 13, 2026
3d8460e
Weigh each share as the model stores it, and let income reach a limit
MaxGhenis Nov 13, 2026
f6a149a
Count a share as meeting the rate test in either arithmetic
MaxGhenis Nov 14, 2026
6788c8e
Keep the nearest float32 rounding unless it wins a false reduction
MaxGhenis Nov 14, 2026
7877bca
Keep the nearest float32 rounding wherever it leaves the least tax
MaxGhenis Nov 14, 2026
ef2b37b
Rank last a rounding that meets the rate test only in float32
MaxGhenis Nov 14, 2026
965b9d1
Pin the float64 arm of the rate test on the stored share
MaxGhenis Nov 14, 2026
a95ea20
Hold the property test's strict check a penny inside the savings band
MaxGhenis Nov 15, 2026
dfb2cde
Leave out of the property test a recipient across an allowance step
MaxGhenis Nov 15, 2026
f884921
Pin OVER_DEDUCTION and the exact-share condition of _stored_share
MaxGhenis Nov 15, 2026
193d6c9
Pin the table's fourth row in a YAML case that fails on main
MaxGhenis Nov 15, 2026
fc07daa
Pin the float32 arm of the rate test and the nearest rounding's exemp…
MaxGhenis Nov 15, 2026
b0d4725
Correct comments and docstrings on float32 limits and held amounts
MaxGhenis Nov 15, 2026
200dc10
Correct two float32 claims in the allocation module's docstring
MaxGhenis Nov 15, 2026
259bbb9
Hold the rate test to room where float32 can hide a penny
MaxGhenis Nov 15, 2026
82a24d0
Bound the property test's feasibility check by float32 error
MaxGhenis Nov 15, 2026
5c8c5e1
Pin the nearest rounding and the line at the room
MaxGhenis Nov 15, 2026
6aa9124
Keep the rate test's room where float32 can hide an excess behind the…
MaxGhenis Nov 15, 2026
e4ad32c
Wrap two docstring lines in the allocation module
MaxGhenis Nov 15, 2026
c7cf190
Read an amount supplied as an input as an entry in the rate test's guard
MaxGhenis Nov 16, 2026
dc87f9c
Bound what a supplied amount hides from the rate test's guard, and pi…
MaxGhenis Nov 16, 2026
2441024
State the supplied-amount rule in the allocation docstrings and the c…
MaxGhenis Nov 16, 2026
e521645
Say what the room costs in two new tests, and correct two comments
MaxGhenis Nov 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/marriage-allowance-rate-test-limit.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The search for the least-tax share of reliefs and allowances now applies the Marriage Allowance rate test at the statutory limits, instead of with room below them (about 3.9p near the £37,700 basic rate limit), so a recipient whose only qualifying share leaves income at a limit gets the reduction. The search keeps the room where float32 could hold income entered over a limit at the limit: where an amount the test reads reaches £65,536, or where the model cannot bound the float32 error in the amounts behind it, such as pay before expenses, under the least amount the entries can sit over a limit. An amount supplied as an input in place of its formula, such as pay set through Simulation.set_input or in a YAML test, counts as an entry: the model bounds that amount's own float32 error, with no bound from £131,072, and does not read the amounts its formula would.
Original file line number Diff line number Diff line change
Expand Up @@ -552,3 +552,124 @@
meets_marriage_allowance_income_conditions: [true, true]
marriage_allowance_tax_reduction: [252, 0]
income_tax: [7_088, 0]

- name: Case 24, a recipient's only qualifying share leaves pay exactly at the basic rate limit
period: 2026
absolute_error_margin: 0.01
input:
people:
recipient:
age: 40
employment_income: 40_200
savings_interest_income: 9_000
dividend_income: 1_570
partner:
age: 40
benunit:
members: [recipient, partner]
is_married: true
output:
# Income after the allowance is 50,770 - 12,570 = 38,200, above the basic
# rate limit, so the savings allowance is £500 in every share (s. 12B).
# The rate test (s. 55B(2)(b) and (ba)) needs no dividends left, at most
# £500 of savings left and at most £37,700 of pay left, so one share meets
# it: £2,500 against pay, £8,500 against savings and £1,570 against
# dividends. Its tax is 37,700 x 20% = 7,540, less 252: £7,288. Without
# the reduction the least tax is £7,440 (£11,500 against pay and £1,070
# against dividends).
received_allowances_earned_income: [2_500, 0]
received_allowances_savings_income: [8_500, 0]
received_allowances_dividend_income: [1_570, 0]
income_tax_pre_charges: [7_540, 0]
meets_marriage_allowance_income_conditions: [true, true]
marriage_allowance_tax_reduction: [252, 0]
income_tax: [7_288, 0]

- name: Case 25, a recipient's share leaves pay 2p below the basic rate limit
period: 2026
absolute_error_margin: 0.01
input:
people:
recipient:
age: 40
employment_income: 40_199.98
savings_interest_income: 9_000
dividend_income: 1_570
partner:
age: 40
benunit:
members: [recipient, partner]
is_married: true
output:
# As Case 24 with 2p less pay. The same deductions leave £37,699.98 of pay
# and £500 of savings at the savings nil rate: 37,699.98 x 20% =
# 7,539.996, less 252: £7,287.996.
received_allowances_earned_income: [2_500, 0]
received_allowances_savings_income: [8_500, 0]
received_allowances_dividend_income: [1_570, 0]
meets_marriage_allowance_income_conditions: [true, true]
marriage_allowance_tax_reduction: [252, 0]
income_tax: [7_287.996, 0]

- name: Case 26, a recipient sets the allowance against dividends to stop pay at the basic rate limit
period: 2026
absolute_error_margin: 0.01
input:
people:
recipient:
age: 40
employment_income: 50_000
savings_interest_income: 500
dividend_income: 270
partner:
age: 40
benunit:
members: [recipient, partner]
is_married: true
output:
# The old order leaves £37,430 of pay, £500 of savings at the savings nil
# rate and £270 of dividends within the dividend allowance, for the least
# Step 5 tax, 37,430 x 20% = 7,486. Its £270 of dividends end above the
# basic rate limit, so it fails the rate test (s. 55B(2)(ba)). Setting
# £270 against dividends and £12,300 against pay leaves £37,700 of pay and
# £500 of savings: 37,700 x 20% = 7,540, less 252: £7,288.
received_allowances_earned_income: [12_300, 0]
received_allowances_savings_income: [0, 0]
received_allowances_dividend_income: [270, 0]
income_tax_pre_charges: [7_540, 0]
meets_marriage_allowance_income_conditions: [true, true]
marriage_allowance_tax_reduction: [252, 0]
income_tax: [7_288, 0]

- name: Case 27, a recipient sets a penny against dividends to stop pay at the basic rate limit
period: 2026
absolute_error_margin: 0.01
input:
people:
recipient:
age: 40
employment_income: 50_269.99
savings_interest_income: 500
dividend_income: 0.01
partner:
age: 40
benunit:
members: [recipient, partner]
is_married: true
output:
# Income after the allowance is 50,770 - 12,570 = 38,200, above the basic
# rate limit, so the savings allowance is £500 in every share (s. 12B).
# The old order leaves £37,699.99 of pay, £500 of savings at the savings
# nil rate and 1p of dividends within the dividend allowance, for the
# least Step 5 tax, 37,699.99 x 20% = 7,539.998. Its 1p of dividends ends
# above the basic rate limit, so it fails the rate test (s. 55B(2)(ba)).
# Only one share meets the test: 1p against dividends and £12,569.99
# against pay, which leaves £37,700 of pay and £500 of savings: 37,700 x
# 20% = 7,540, less 252: £7,288.
received_allowances_earned_income: [12_569.99, 0]
received_allowances_savings_income: [0, 0]
received_allowances_dividend_income: [0.01, 0]
income_tax_pre_charges: [7_540, 0]
meets_marriage_allowance_income_conditions: [true, true]
marriage_allowance_tax_reduction: [252, 0]
income_tax: [7_288, 0]
Loading
Loading