Skip to content

[LQP Meta] Add a debug pretty-printer mode#192

Open
nystrom wants to merge 76 commits intomainfrom
nn-meta-13c-print-debug-info
Open

[LQP Meta] Add a debug pretty-printer mode#192
nystrom wants to merge 76 commits intomainfrom
nn-meta-13c-print-debug-info

Conversation

@nystrom
Copy link
Contributor

@nystrom nystrom commented Feb 13, 2026

Add a second mode to the pretty printer to print numerical relation ids rather than looking up in the DebugInfo map, then print the debug info at the end.

nystrom and others added 16 commits February 18, 2026 10:34
Resolve conflicts:
- Python template: take origin/main as base, add debug-info features
- python-tools/src/lqp/gen/pretty.py: delete (moved to sdks/python/)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add print_symbolic_relation_ids param and write_debug_info to both
  Python and Julia templates
- Add pretty_debug() free function to both templates
- Generate _pprint_dispatch methods via codegen for Julia (type-based
  dispatch to pretty_<nonterminal> functions)
- Add pprint API to Julia template: pprint(io, x), pprint(io, debug),
  pprint(io, fragment_id), and pprint(x) convenience
- Add gen_pprint_dispatch_line to CodeGenerator base (returns None by
  default, overridden in Julia codegen)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The helper was finding the try_flat IfElse wrapper instead of the
guarded alternative IfElse. Add _is_try_flat_let() to detect the
Let(var, try_flat_io(...), IfElse(...)) pattern and recurse into
its else_branch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…meta-13c-print-debug-info

# Conflicts:
#	meta/tests/meta/test_pretty_gen.py
Add printSymbolicRelationIds field, writeDebugInfo method, and
ProgramToStrDebug function to the Go template, matching the
Python and Julia implementations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add tests/pretty_debug/ with snapshot files generated by pretty_debug.
Add snapshot tests for Python, Julia, and Go that compare
ProgramToStrDebug output against these snapshots.

Sort debug info entries by name in all three templates for
deterministic output across languages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nystrom nystrom changed the base branch from main to nn-meta-13b-go-printer February 19, 2026 10:59
nystrom and others added 4 commits February 19, 2026 12:05
Use 032x formatting in format_uint128 across all three templates
so relation IDs always print as 32 hex digits. Regenerate all
snapshots.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change relation_id_to_string to return an option type instead of
empty string on failure: str|None in Python, Union{String,Nothing}
in Julia, *string in Go. Update grammar deconstruct functions to
use is_none/is_some checks. Remove unused relationIdToInt from Go
template.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Base automatically changed from nn-meta-13b-go-printer to main February 19, 2026 14:19
@nystrom nystrom requested a review from comnik February 19, 2026 14:38
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

Comments