Skip to content

fix(memory): retain cgroup pressure after allocator trim - #2851

Merged
ScriptedAlchemy merged 2 commits into
masterfrom
cursor/cgroup-pressure-after-trim-9eae
Oct 2, 2026
Merged

ScriptedAlchemy merged 2 commits into
masterfrom
cursor/cgroup-pressure-after-trim-9eae

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

Supersedes #2596 (agent/master-unpushed-20260928). That pull request is left open.

  • After an allocator trim, admission keeps the cgroup-aware sample. Publishing the post-trim unreclaimable RSS was clearing a kill-line observation.
  • A failed checkpoint read returns the standing pressure verdict. Callers were treating None as room to keep allocating.
  • The parent-carried lexical artifact path is withdrawn. It sealed incomplete source receipts under the current format revision. A carried marker is incompatible and the next build is a full rebuild.

Motivation

#2596 conflicted with current master and its six Linux Hauler lanes failed against its pinned base. Diffed against current master first:

Changes

  • register_process_allocator_pressure_reclaimer_v1 re-reads through sample_for_checkpoint after the trim instead of publish_post_reclaim_observed_resident_bytes.
  • sample_for_checkpoint returns ResidentMemoryPressureStateV1. A failed sample leaves the last published verdict in place. Checkpoint and graph-publication callers use that verdict.
  • Deleted the parent-carry delta (artifact/delta.rs), the source restriction that fed it, and restart_after_sigterm_rebuilds_only_changed_files. That test asserted the withdrawn optimization (only the edited file is rebuilt). wait_for_refresh_in_flight existed only for it. Unchanged files stay searchable because the successor build is a full text artifact. Existing carried staging files fail layout verification and are rebuilt.

Test plan

  • cargo fmt --all -- --check — exit 0
  • cargo clippy -p tracedecay-runtime-core -p tracedecay-application -p tracedecay-store-runtime -p tracedecay-code-index -p tracedecay-query -p tracedecay-code-index-runtime --all-targets -- -D warnings — exit 0
  • cargo clippy -p tracedecay --test daemon_suite --features test-helpers -- -D warnings — exit 0
  • cargo test -p tracedecay-runtime-core --lib resident_memory — 51 passed
  • cargo test -p tracedecay-application --lib code_index:: — 2 passed (checkpoint_sampling_failure_preserves_known_pressure, a_checkpoint_stops_at_the_watermark_without_reclaiming)
  • cargo test -p tracedecay-store-runtime --lib resident_memory_trip_is_permanent_for_one_publication_attempt — 1 passed
  • cargo test -p tracedecay-query --lib — 275 passed, 1 ignored
  • cargo test -p tracedecay-code-index --lib — 270 passed
  • cargo test -p tracedecay-code-index-runtime --lib — 562 passed, 1 ignored
  • cargo test -p tracedecay-code-index-runtime --lib staging_sidecar_tests — 1 passed
  • cargo test -p tracedecay-code-index-retention --lib staging_sidecars_share_their_staging_artifact_liveness — 1 passed
  • cargo test -p tracedecay-code-index --lib lexical_page — 12 passed
  • cargo nextest run --workspace --no-fail-fast not run
  • Changelog left to release-please
  • No secrets included
  • No breaking external API; sample_for_checkpoint is an in-workspace signature change and every caller is updated

bounded_restore_refuses_a_same_inode_rewrite_witness failed once inside the first full tracedecay-query lib run and did not reproduce across eight consecutive reruns of that suite. The test and the restore witness path are unchanged from master; the assertion is still Corrupt.

Open in Web Open in Cursor 

ScriptedAlchemy and others added 2 commits October 2, 2026 01:01
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Oct 2, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2d27d53

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy merged commit e969511 into master Oct 2, 2026
14 of 15 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the cursor/cgroup-pressure-after-trim-9eae branch October 10, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant