镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Retire hot ops at their authored stamps - #4637

Merged
TrueDoctor merged 1 commit into
masterfrom
graph-storage-3-retirement-stamps
Oct 7, 2026
Merged

TrueDoctor merged 1 commit into
masterfrom
graph-storage-3-retirement-stamps

Conversation

@TrueDoctor

Copy link
Copy Markdown
Member

No description provided.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 8 files

Confidence score: 4/5

  • history.rs can substantially increase peak memory when loading large histories by keeping the input vector alongside a second deltas vector. Keep the supplied vector as History.deltas and derive the indexes from it.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="document/graph-storage/src/history.rs">

<violation number="1" location="document/graph-storage/src/history.rs:35">
P2: Loading a large history now retains the input vector while building a second `deltas` vector, substantially increasing peak memory. Keep the supplied vector as `History.deltas` and derive the indexes from it.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread document/graph-storage/src/crdt.rs Outdated
Comment thread document/graph-storage/src/session.rs
Comment thread node-graph/rfcs/document-format.md
Comment thread document/graph-storage/src/crdt.rs
pub fn from_ordered(deltas: Vec<Delta>) -> Self {
let index = deltas.iter().enumerate().map(|(position, delta)| (delta.id, position)).collect();
Self { deltas, index }
let mut history = Self::default();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Loading a large history now retains the input vector while building a second deltas vector, substantially increasing peak memory. Keep the supplied vector as History.deltas and derive the indexes from it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At document/graph-storage/src/history.rs, line 35:

<comment>Loading a large history now retains the input vector while building a second `deltas` vector, substantially increasing peak memory. Keep the supplied vector as `History.deltas` and derive the indexes from it.</comment>

<file context>
@@ -27,8 +32,9 @@ impl History {
 	pub fn from_ordered(deltas: Vec<Delta>) -> Self {
-		let index = deltas.iter().enumerate().map(|(position, delta)| (delta.id, position)).collect();
-		Self { deltas, index }
+		let mut history = Self::default();
+		deltas.into_iter().for_each(|delta| history.push(delta));
+		history
</file context>

Comment thread document/graph-storage/src/history.rs
Comment thread document/graph-storage/src/crdt.rs
Comment thread document/graph-storage/src/crdt.rs Outdated
Comment thread document/graph-storage/src/history.rs
@TrueDoctor
TrueDoctor force-pushed the graph-storage-3-retirement-stamps branch from 9e26847 to 349b672 Compare October 7, 2026 18:04
@TrueDoctor
TrueDoctor added this pull request to the merge queue Oct 7, 2026
Merged via the queue into master with commit e4bcb13 Oct 7, 2026
11 checks passed
@TrueDoctor
TrueDoctor deleted the graph-storage-3-retirement-stamps branch October 7, 2026 18:54
@Keavon Keavon mentioned this pull request Oct 10, 2026
5 of 51 tasks

This branch was successfully deployed

1 active deployment
graphite-dev (Preview) — 349b6722 Deployed Oct 7, 2026 by github-actions[bot]
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.

2 participants