Skip to content

fix(hydro_lang): add forwardref cycle detection, fix #2080#2399

Open
Shasha-17 wants to merge 4 commits intohydro-project:mainfrom
Shasha-17:fix-forwardref-cycle-detection
Open

fix(hydro_lang): add forwardref cycle detection, fix #2080#2399
Shasha-17 wants to merge 4 commits intohydro-project:mainfrom
Shasha-17:fix-forwardref-cycle-detection

Conversation

@Shasha-17
Copy link
Copy Markdown

No description provided.

@MingweiSamuel MingweiSamuel changed the title Add regression test for forwardref cycle detection fix(hydro_lang): add forwardref cycle detection, fix #2080 Dec 31, 2025
@MingweiSamuel
Copy link
Copy Markdown
Member

Prev #2159

@MingweiSamuel MingweiSamuel requested a review from a team May 1, 2026 20:22

while let Some(ptr) = stack.pop() {
if !seen.insert(ptr as usize) { continue; }
let node: &HydroNode = unsafe { &*ptr };
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is this unsafe necessary?

if !seen.insert(ptr as usize) { continue; }
let node: &HydroNode = unsafe { &*ptr };

if matches!(node, HydroNode::DeferTick { .. }) { return; }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is DeferTick the only operation that can interrupt the cycle?

stack.push(&**inner as *const _);
}

_ => {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Are there any missing arms? New variants would not have their inner dataflow graphs analyzed right?

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.

3 participants