Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Migrate simulation caching to Core ownership APIs

Open
#9,978 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

  • #9980 by @anth-volk — closed without merging

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

This work depends on policyengine-core#598 and its released cache ownership APIs; first confirm the required Core release and update the US dependency constraint and lockfile. Then locate the SPM simulation, reform, holder-rebinding, and period-override code that accesses the private cache fields described in the issue, and review the focused SPM, source-input, and branch tests. Done means those paths use public Core operations, preserve sharing, isolation, inputs, branch behavior, and trace attribution, and the specified tests pass; an open linked pull request is already in progress.

Written by the indexing model from the issue text.

Description

Context

PolicyEngine US currently contains SPM simulation and period-branch code that
modifies private PolicyEngine Core cache fields. Those paths manually clear
parameter views, supplied-input records, holder storage, and fast result
lookups. The SPM tracing workaround also copies parameter roots to prevent one
simulation's tracer from being retained by shared parameter state.

Dependency

This work depends on PolicyEngine/policyengine-core#598 and the Core release
that contains its public cache ownership APIs. The US dependency constraint and
lockfile must reference that release before this change can merge.

Scope

  • Use Core's public parameter-sharing and parameter-replacement operations for
    SPM policy copy-on-write behavior.
  • Remove the SPM-specific parameter tracing workaround after Core makes tracing
    local to each calculation.
  • Use Core's supplied-input provenance operations during holder rebinding.
  • Use Core's calculated-result clearing operation for period override branches.
  • Preserve policy-system sharing, reform isolation, branch behavior, and trace
    attribution.

Acceptance criteria

  • Production code no longer reads or writes the targeted private parameter,
    supplied-input, holder-storage, or fast-result cache fields.
  • Separate traced simulations record their own parameter accesses without
    modifying the shared parameter tree.
  • SPM reforms detach parameter trees before mutation.
  • Period override branches preserve supplied inputs and remove calculated
    values.
  • Formatting, focused SPM tests, source-input tests, and branch tests pass
    against the released Core version.
  • The minimum Core version and lockfile include the required release.

This refactor does not change tax or benefit policy rules, so Axiom parity is
not applicable.

Dominant language
Python
Stars
168
Forks
216
Avg merge
3d 1h
Merged PRs (30d)
339

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PolicyEngine/policyengine-us

All issues in PolicyEngine/policyengine-us

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.