Skip to content

Commit d1e52f4

Browse files
authored
Fix PolicyBench audit issues (#1690)
1 parent 443b8b1 commit d1e52f4

17 files changed

Lines changed: 367 additions & 86 deletions

File tree

changelog.d/1681.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fixed PolicyBench audit issues in Pension Credit, Capital Gains Tax, and income-tax source ordering, including mixed-age Pension Credit eligibility, property income in Pension Credit, CGT rate-band allocation, savings/dividend ordering, HICBC regression coverage, and property income-tax banding.

policyengine_uk/parameters/gov/dwp/pension_credit/guarantee_credit/income.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ values:
1414
- working_tax_credit
1515
- state_pension
1616
- private_pension_income
17+
- property_income
1718
- pension_credit_deemed_income
1819
- esa_contrib
1920
- jsa_contrib

policyengine_uk/tests/policy/baseline/finance/tax/income_tax/savings_starter_rate_income.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
period: 2024
33
input:
44
basic_rate_savings_income_pre_starter: 5_000
5+
taxable_savings_interest_income: 6_000
6+
received_allowances_savings_income: 0
57
earned_taxable_income: 15_000
68
taxable_dividend_income: 0
79
output:
@@ -11,6 +13,8 @@
1113
period: 2024
1214
input:
1315
basic_rate_savings_income_pre_starter: 4_000
16+
taxable_savings_interest_income: 5_000
17+
received_allowances_savings_income: 0
1418
earned_taxable_income: 19_000
1519
taxable_dividend_income: 0
1620
output:
@@ -20,7 +24,9 @@
2024
period: 2024
2125
input:
2226
basic_rate_savings_income_pre_starter: 2_000
23-
earned_taxable_income: 22_000
27+
taxable_savings_interest_income: 3_000
28+
received_allowances_savings_income: 0
29+
earned_taxable_income: 23_000
2430
taxable_dividend_income: 1_000
2531
output:
2632
savings_starter_rate_income: 0
@@ -29,6 +35,8 @@
2935
period: 2024
3036
input:
3137
basic_rate_savings_income_pre_starter: 10_000
38+
taxable_savings_interest_income: 11_000
39+
received_allowances_savings_income: 0
3240
earned_taxable_income: 16_000
3341
taxable_dividend_income: 0
3442
output:
@@ -38,7 +46,9 @@
3846
period: 2024
3947
input:
4048
basic_rate_savings_income_pre_starter: 5_000
49+
taxable_savings_interest_income: 6_000
50+
received_allowances_savings_income: 0
4151
earned_taxable_income: 16_000
4252
taxable_dividend_income: 2_000
4353
output:
44-
savings_starter_rate_income: 4_570
54+
savings_starter_rate_income: 5_000
Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,77 @@
1-
- name: Not pension-age, ineligible for Pension Credit (single)
2-
period: 2022
1+
- name: Case 1, single adult below State Pension age is ineligible.
2+
period: 2026
33
input:
44
people:
5-
person:
6-
is_SP_age: false
5+
person1:
6+
age: 54
7+
benunits:
8+
benunit:
9+
members: [person1]
10+
output:
11+
is_pension_credit_eligible: false
12+
13+
- name: Case 2, single adult above State Pension age is eligible.
14+
period: 2026
15+
input:
16+
people:
17+
person1:
18+
age: 79
19+
benunits:
20+
benunit:
21+
members: [person1]
22+
output:
23+
is_pension_credit_eligible: true
24+
25+
- name: Case 3, couple with both adults above State Pension age is eligible.
26+
period: 2026
27+
input:
28+
people:
29+
person1:
30+
age: 79
31+
person2:
32+
age: 70
33+
benunits:
34+
benunit:
35+
members: [person1, person2]
36+
output:
37+
is_pension_credit_eligible: true
38+
39+
- name: Case 4, mixed-age couple without protected exception is ineligible.
40+
period: 2026
41+
input:
42+
people:
43+
person1:
44+
age: 79
45+
person2:
46+
age: 54
47+
benunits:
48+
benunit:
49+
members: [person1, person2]
750
output:
851
is_pension_credit_eligible: false
952

10-
- name: One member of a couple is pension age; eligible for Pension Credit
11-
period: 2022
53+
- name: Case 5, child in benefit unit does not block pension-age adult eligibility.
54+
period: 2026
1255
input:
1356
people:
14-
person:
15-
is_SP_age: false
16-
spouse:
17-
is_SP_age: true
57+
person1:
58+
age: 79
59+
person2:
60+
age: 10
1861
benunits:
1962
benunit:
20-
members: [person, spouse]
63+
members: [person1, person2]
2164
output:
2265
is_pension_credit_eligible: true
66+
67+
- name: Case 6, child-only benefit unit is ineligible.
68+
period: 2026
69+
input:
70+
people:
71+
person1:
72+
age: 10
73+
benunits:
74+
benunit:
75+
members: [person1]
76+
output:
77+
is_pension_credit_eligible: false

policyengine_uk/tests/policy/baseline/gov/dwp/pension_credit/pension_credit_income.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,25 @@
5858
pension_credit_assessable_capital: 10_001
5959
pension_credit_deemed_income: 52
6060
pension_credit_income: 52
61+
62+
- name: Case 4, property income and non-main-home capital count for Pension Credit.
63+
period: 2026
64+
absolute_error_margin: 0.01
65+
input:
66+
people:
67+
person1:
68+
age: 79
69+
property_income: 10_476
70+
benunits:
71+
benunit:
72+
members: [person1]
73+
households:
74+
household:
75+
members: [person1]
76+
other_residential_property_value: 55_370
77+
savings: 455
78+
output:
79+
pension_credit_assessable_capital: 55_825
80+
pension_credit_deemed_income: 4_784
81+
pension_credit_income: 15_260
82+
pension_credit: 0

policyengine_uk/tests/policy/baseline/gov/hmrc/capital_gains_tax/capital_gains_tax.yaml

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
adjusted_net_income: 20_000
2929
capital_gains: 23_000
3030
output:
31-
capital_gains_tax: 2_230
31+
capital_gains_tax: 2_000
3232

3333
- name: Higher rate capital gains tax
3434
period: 2024
3535
input:
3636
adjusted_net_income: 50_000
3737
capital_gains: 50_000
3838
output:
39-
capital_gains_tax: 9_400
39+
capital_gains_tax: 9_373
4040

4141
- name: Additional rate capital gains tax
4242
period: 2024
@@ -52,15 +52,15 @@
5252
adjusted_net_income: 35_000
5353
capital_gains: 40_000
5454
output:
55-
capital_gains_tax: 7_130
55+
capital_gains_tax: 5_873
5656

5757
- name: High capital gains, low income
5858
period: 2024
5959
input:
6060
adjusted_net_income: 10_000
6161
capital_gains: 200_000
6262
output:
63-
capital_gains_tax: 36_630
63+
capital_gains_tax: 35_630
6464

6565
- name: Very high capital gains and income
6666
period: 2024
@@ -76,4 +76,50 @@
7676
adjusted_net_income: 0
7777
capital_gains: 3_000
7878
output:
79-
capital_gains_tax: 0
79+
capital_gains_tax: 0
80+
81+
- name: Case 11, two adults each receive the annual exempt amount.
82+
period: 2026
83+
input:
84+
people:
85+
person1:
86+
capital_gains: 151_800
87+
person2:
88+
capital_gains: 151_800
89+
benunit:
90+
members: [person1, person2]
91+
output:
92+
capital_gains_tax: [33_450, 33_450]
93+
94+
- name: Case 12, ordinary income below allowances leaves the full basic rate band for gains.
95+
period: 2026
96+
absolute_error_margin: 0.01
97+
input:
98+
people:
99+
person1:
100+
adjusted_net_income: 9_324
101+
capital_gains: 228_890
102+
person2:
103+
capital_gains: -124_972
104+
benunit:
105+
members: [person1, person2]
106+
output:
107+
capital_gains_tax: [51_951.60, 0]
108+
109+
- name: Case 13, Gift Aid extends the basic rate band for capital gains.
110+
period: 2018
111+
input:
112+
adjusted_net_income: 41_850
113+
gift_aid: 40_000
114+
capital_gains: 70_000
115+
output:
116+
capital_gains_tax: 6_210
117+
118+
- name: Case 14, personal pension contributions extend the basic rate band for capital gains.
119+
period: 2026
120+
input:
121+
employment_income: 52_570
122+
personal_pension_contributions: 10_000
123+
capital_gains: 30_000
124+
output:
125+
capital_gains_tax: 6_018

policyengine_uk/tests/policy/baseline/gov/hmrc/income_tax/charges/child_benefit_hitc.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,26 @@
2727
employment_income: 60_000
2828
output:
2929
CB_HITC: 1_000
30+
31+
- name: Case 5, high-income family pays one full Child Benefit charge.
32+
period: 2026
33+
absolute_error_margin: 0.01
34+
input:
35+
people:
36+
person1:
37+
age: 40
38+
self_employment_income: 113_850
39+
person2:
40+
age: 38
41+
employment_income: 35_000
42+
person3:
43+
age: 8
44+
person4:
45+
age: 5
46+
benunit:
47+
members: [person1, person2, person3, person4]
48+
output:
49+
child_benefit: 2_328.16
50+
CB_HITC: [2_328.16, 0, 0, 0]
51+
income_tax_pre_charges: [35_142, 4_486, 0, 0]
52+
income_tax: [37_470.16, 4_486, 0, 0]

policyengine_uk/tests/policy/integration/income.yaml

Lines changed: 70 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
output:
2323
basic_rate_savings_income_pre_starter: 10_000
2424
savings_starter_rate_income: 0
25-
basic_rate_savings_income: 10_000
25+
basic_rate_savings_income: 9_500
2626
savings_allowance: 500
27-
higher_rate_savings_income: 4_500
27+
higher_rate_savings_income: 5_000
2828
taxed_savings_income: 14_500
2929

3030
- name: Dividends taxed at the marginal rates
@@ -35,7 +35,73 @@
3535
# Nullify Personal Allowance for testing purposes
3636
gov.hmrc.income_tax.allowances.personal_allowance.amount: 0
3737
output:
38-
dividend_income_tax: 6_225
38+
dividend_income_tax: 6_725
39+
40+
- name: Savings and dividend allowances occupy tax bands before taxable income.
41+
period: 2027
42+
absolute_error_margin: 0.01
43+
input:
44+
employment_income: 50_000
45+
savings_interest_income: 1_000
46+
dividend_income: 1_000
47+
output:
48+
earned_taxable_income: 37_430
49+
savings_allowance: 500
50+
basic_rate_savings_income: 0
51+
higher_rate_savings_income: 500
52+
savings_income_tax: 210
53+
taxed_dividend_income: 500
54+
dividend_income_tax: 178.75
55+
income_tax: 7_874.75
56+
57+
- name: Personal allowance caps savings starter rate before dividends.
58+
period: 2027
59+
absolute_error_margin: 0.01
60+
input:
61+
employment_income: 10_000
62+
savings_interest_income: 5_000
63+
dividend_income: 5_000
64+
output:
65+
received_allowances_savings_income: 2_570
66+
basic_rate_savings_income_pre_starter: 2_430
67+
savings_starter_rate_income: 2_430
68+
savings_allowance: 1_000
69+
savings_income_tax: 0
70+
taxed_dividend_income: 4_500
71+
dividend_income_tax: 483.75
72+
income_tax: 483.75
73+
74+
- name: Starter-rate savings applies before personal savings allowance.
75+
period: 2027
76+
absolute_error_margin: 0.01
77+
input:
78+
employment_income: 12_570
79+
savings_interest_income: 5_500
80+
output:
81+
basic_rate_savings_income_pre_starter: 5_500
82+
savings_starter_rate_income: 5_000
83+
savings_allowance: 1_000
84+
basic_rate_savings_income: 0
85+
savings_income_tax: 0
86+
income_tax: 0
87+
88+
- name: Property income uses post-allowance rate bands.
89+
period: 2026
90+
absolute_error_margin: 0.01
91+
input:
92+
people:
93+
person1:
94+
taxable_property_income: 75_900
95+
savings_interest_income: 2_900
96+
person2:
97+
taxable_property_income: 46_451
98+
savings_interest_income: 1_525
99+
benunit:
100+
members: [person1, person2]
101+
output:
102+
property_income_tax: [17_792, 6_776.20]
103+
savings_income_tax: [0, 0]
104+
income_tax: [17_792, 6_776.20]
39105

40106
- name: Household net income can be negative
41107
period: 2020
@@ -45,4 +111,4 @@
45111
household_tax: 2
46112
household_benefits: 0
47113
output:
48-
household_net_income: -1
114+
household_net_income: -1

0 commit comments

Comments
 (0)