Migrate simulation caching to Core ownership APIs
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
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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PolicyEngine/policyengine-us
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/policyengine-us#10262 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PolicyEngine/policyengine-us#10179 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
PolicyEngine/policyengine-us#10073 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PolicyEngine/policyengine-us#10072 ·
Maintainers usually reply within 2 days
-
bug state-income-tax states/vt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PolicyEngine/policyengine-us#9996 ·
Maintainers usually reply within 2 days
All issues in PolicyEngine/policyengine-us
Similar issues
-
bot-triaged module: LrScheduler module: optimizer triaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
documentation glm5 llm-model
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/vllm-ascend#19062 ·
Maintainers usually reply within 1 day
-
author-page correction
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
acl-org/acl-anthology#10496 · 1 comment ·
Maintainers usually reply within 1 day
-
Issue Type: Bug Report
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
celery/celery#10875 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
SasanLabs/VulnerableApp#836 ·
Maintainers usually reply within 1 day