Skip to content

Marriage Allowance: which allowance share does the s. 55B(2)(ba) dividend test read? #2915

Open

Description

@MaxGhenis

test_tax_band_scottish_properties.py::test_marriage_allowance_follows_the_liability_with_nil_rates fails on main (d3db7ac) for some Hypothesis draws. Its settings don't set derandomize, so CI can fail on any pull request that draws such a case.

A failing case

In 2019-20, a single Scottish taxpayer has pay of £50,270 and dividends of £917. The drawn reform sets the basic rate limit to £31,138 and the dividend allowance to £2,458, among other changes (script below).

  • The dividends bear the dividend nil rate, so the model sets the whole Personal Allowance against pay. Income other than dividends then exceeds the basic rate limit, so all the dividends sit above it.
  • s. 55B(2)(ba) asks whether the recipient would bear the dividend upper rate "if section 13A (dividend nil rate) were omitted".

Two readings

  1. Hold the share that s. 25(2) gives under the actual law. The model has done this since Set reliefs and allowances against income for the least tax #2830. All £917 of dividends would bear the upper rate, so the recipient fails the test.
  2. Work the liability again without s. 13A, s. 25(2) included. The test does this. Without the nil rate, the model's own search sets £917 of the allowance against the dividends, so none bear the upper rate and the recipient passes.

The subsection omits s. 13A and nothing else, so s. 25(2) still applies inside the counterfactual. That supports the second reading, which makes this a model bug rather than a test bug. Under it, the model would give the reduction to more recipients with dividends at the nil rate.

Next step

#2913 changes the same rate test and gives the same answer for this case, so the fix should follow it. Under the second reading, the model applies the dividend test to the share with the least tax without s. 13A. Under the first, the test holds the model's share fixed. Either way, an @example should pin this draw.

Replay script
import numpy as np
from policyengine_uk import Simulation
import policyengine_uk.tests.test_tax_band_scottish_properties as t

period = 2019
sim = Simulation(situation={
    "people": {"p": {"age": {period: 40}, "employment_income": {period: 50_270}, "dividend_income": {period: 917}}},
    "benunits": {"b": {"members": ["p"]}},
    "households": {"h": {"members": ["p"], "country": {period: "SCOTLAND"}}},
})
changes = {
    t.BASIC_RATE_LIMIT: 31_138,
    "gov.hmrc.income_tax.rates.scotland.rates[3].threshold": 42_661,
    t.DIVIDEND_ALLOWANCE: 2_458,
    t.STARTING_RATE_LIMIT: 23_279,
    "gov.hmrc.income_tax.allowances.personal_savings_allowance.basic": 2_840,
    "gov.hmrc.income_tax.allowances.personal_savings_allowance.higher": 2_692,
}
changes[t.DIVIDEND_UPPER_START] = changes[t.BASIC_RATE_LIMIT]
f = lambda v: float(np.asarray(sim.calculate(v, period))[0])
with t.law(sim, period, changes):
    print("meets", f("meets_marriage_allowance_income_conditions"))  # 0.0
    print("allowances against dividends", f("received_allowances_dividend_income"))  # 0.0
    with t.law(sim, period, {t.DIVIDEND_ALLOWANCE: 0}):
        print("nil allowance: against dividends", f("received_allowances_dividend_income"))  # 917.0
        print("nil allowance: at the upper rates", float(t.charged_at(sim, period, t.DIVIDEND_UPPER)[0]))  # 0.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions