Skip to content

Use symbol printer when printing flow-analysis debugging info - #532

Merged
LPTK merged 14 commits into
hkust-taco:hkmc2from
LPTK:use-symbol-printer-for-analysis
Oct 2, 2026
Merged

LPTK merged 14 commits into
hkust-taco:hkmc2from
LPTK:use-symbol-printer-for-analysis

Conversation

@LPTK

@LPTK LPTK commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

LPTK added 4 commits June 23, 2026 18:46
# Conflicts:
#	hkmc2/shared/src/test/mlscript/deforest/eta-expansion/recursive.mls
…er-for-analysis

Preserve printable flow-analysis symbols with upstream identity-based strategies and SCC bound queries, and regenerate golden outputs.

Validation: ctest; hkmc2AllTests/test (all passed).
@LPTK
LPTK force-pushed the use-symbol-printer-for-analysis branch from b889f75 to 9c84b90 Compare September 18, 2026 08:42
@LPTK
LPTK marked this pull request as ready for review September 18, 2026 08:48
@LPTK
LPTK requested review from ychenfo and a balanced review from Copilot September 18, 2026 08:48

Copilot AI 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.

🟡 Changes recommended

Result identifiers lose UID-based uniqueness, and duplicated strategy variables acquire repeated function suffixes.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates flow-analysis identifiers to use semantic symbols and SymbolPrinter, with refreshed golden snapshots.

Changes:

  • Converts ResultId and StratVar into symbols.
  • Uses symbol-aware formatting for flow and dead-parameter diagnostics.
  • Updates affected diff-test snapshots.
File summaries
File Description
hkmc2/shared/src/main/scala/hkmc2/Uid.scala Removes obsolete UID handlers.
hkmc2/shared/src/main/scala/hkmc2/codegen/flowAnalysis/FlowAnalysis.scala Adds symbol-backed analysis identifiers and logging.
hkmc2/shared/src/main/scala/hkmc2/codegen/DeadParamElim.scala Uses SymbolPrinter in diagnostics.
hkmc2/shared/src/main/scala/hkmc2/codegen/deforest/Rewrite.scala Preserves the identifier union type.
hkmc2/shared/src/test/mlscript/codegen/ConfigDirective.mls Refreshes flow-analysis snapshots.
hkmc2/shared/src/test/mlscript/deforest/basic.mls Refreshes deforestation snapshots.
hkmc2/shared/src/test/mlscript/deforest/determinism.mls Refreshes generated identifier snapshots.
hkmc2/shared/src/test/mlscript/deforest/erasedTypes.mls Refreshes generated identifier snapshots.
hkmc2/shared/src/test/mlscript/deforest/fusibility.mls Refreshes symbol diagnostics.
hkmc2/shared/src/test/mlscript/deforest/recursive.mls Refreshes recursive-flow snapshots.
hkmc2/shared/src/test/mlscript/deforest/simple.mls Refreshes generated helper names.
hkmc2/shared/src/test/mlscript/deforest/todos.mls Refreshes generated helper names.
hkmc2/shared/src/test/mlscript/deforest/eta-expansion/basic.mls Refreshes eta-expansion identifiers.
hkmc2/shared/src/test/mlscript/deforest/eta-expansion/recursive.mls Refreshes recursive eta-expansion identifiers.
hkmc2/shared/src/test/mlscript/dead-param-elim/basic.mls Refreshes dead-parameter diagnostics.
hkmc2/shared/src/test/mlscript/dead-param-elim/clash.mls Refreshes clash diagnostics.
hkmc2/shared/src/test/mlscript/dead-param-elim/class-in-fun.mls Refreshes nested-class diagnostics.
hkmc2/shared/src/test/mlscript/dead-param-elim/config-flags.mls Refreshes configuration snapshots.
hkmc2/shared/src/test/mlscript/dead-param-elim/dead-ref.mls Refreshes dead-reference diagnostics.
hkmc2/shared/src/test/mlscript/dead-param-elim/lambda.mls Refreshes lambda diagnostics.
hkmc2/shared/src/test/mlscript/dead-param-elim/module.mls Refreshes module diagnostics.
hkmc2/shared/src/test/mlscript/dead-param-elim/recursive.mls Refreshes recursive diagnostics.
hkmc2/shared/src/test/mlscript/dead-param-elim/refresher.mls Refreshes rewritten-function identifiers.
Review details
  • Files reviewed: 23/23 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread hkmc2/shared/src/main/scala/hkmc2/codegen/flowAnalysis/FlowAnalysis.scala Outdated
@LPTK
LPTK requested a balanced review from Copilot October 2, 2026 10:23

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Flow-analysis identity and ownership changes affect compiler internals broadly enough to warrant final human validation.

Review effort: Balanced
Findings: 1 High severity · 1 Low severity

Open (2)

@LPTK LPTK left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LGTM, thanks!

@LPTK
LPTK merged commit adaf612 into hkust-taco:hkmc2 Oct 2, 2026
1 check passed
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