Repository navigation
Conversation
Member
Author
|
first commit is missing SOB and commit message. |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical defects can silently drop or alter topology data during export, compile stale graphs after rejected edits, and overwrite cached historical sources.
15 open issues
Isolate class objects during pipeline inheritance resolution · New Prefer decoded private bytes over default parameter includes · New Recognize parser-generated PCM keys during export · New Preserve manifest and binary provenance through text round-trips · New Include DAI links and configurations in full-topology exports · New Invalidate cached search matches immediately after edits · New Protect snapshots from saves that overwrite cached source files · New Compare full audio formats before declaring graphs an exact match · New Require matching structural sets for exact graph matches · New Restore decoded component parameters when reconstructing widgets · New Restore source tabs from their original binary topology · New Abort export when committing text edits fails · New Traverse conditional pattern blocks without entering class templates · New Expand regex replacements using matches from the full buffer · New Treat undecoded SOF ABI versions as unknown · New
What changed in this PR
Adds binary .tplg opening and export to sof-builder, with ABI-aware source discovery and editable graph reconstruction. It also improves platform topology parsing and the integrated text editor.
Changes:
- Decode binary topology metadata, locate matching sources, and support full-topology export.
- Expand conditional configuration parsing and handle file-local topology classes.
- Add editor search/replace, navigation, editing shortcuts, highlighting, and synchronized font controls.
| File | Description |
|---|---|
sof-builder/sof_builder/window.py |
Integrates binary tabs, export actions, and editor controls. |
sof-builder/sof_builder/tplg_ipc4.py |
Decodes ABI metadata and additional topology fields. |
sof-builder/sof_builder/tplg_binary.py |
Resolves versioned sources and reconstructs binary graphs. |
sof-builder/sof_builder/text_editor.py |
Adds editing, search, navigation, and display features. |
sof-builder/sof_builder/serializer.py |
Adds full-topology configuration serialization. |
sof-builder/sof_builder/parser.py |
Expands conditional includes and file-local classes. |
sof-builder/sof_builder/model.py |
Tracks binary provenance and discovers ABI-aware workspaces. |
sof-builder/sof_builder/compiler.py |
Supports binary ABI preservation and explicit export paths. |
Review effort: Balanced
…nsion - parser.py: Expand inline IncludeByKey blocks via _expand_ast_children_inline() and _match_include_by_key(), evaluate integer arithmetic expressions in _eval_int_arith(), add _has_topology_objects() so files with both Class definitions and instantiated Object blocks render pipelines cleanly instead of short-circuiting to an empty class view, and finalize nested pipeline widgets/routes cleanly. - model.py, window.py: Support passing a .conf file path directly on the CLI (discovering the enclosing topology2 workspace root in discover_topology2_dir() and opening the file in a tab on startup). Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
… topology export - Parse ALSA .tplg manifest headers and SOF ABI version bytes (IPC4 <3H> and IPC3 <3B>) in tplg_ipc4.py and tplg_binary.py. - Discover local topology2 checkouts by ABI version and fall back to read-only git archive snapshots cached under ~/.cache/sof-builder/versioned-sources/. - Identify matching .conf source / CMake targets with structural & parameter diffing, or decompile binary pipelines/widgets/routes/controls/PCMs directly into an editable GraphViewModel. - Preserve decoded binary SOF ABI bytes in compiler.py and serialize multi-pipeline topologies to compilable .conf in serializer.py. - Add banner switching, binary/source open flows, and CLI .tplg loading in window.py. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…enu support in text editor - Add monospace font family dropdown, point-size SpinButton, Wrap toggle, and Ctrl++/Ctrl+-/Ctrl+0/Ctrl+Scroll zoom synced across tabs and persisted in ui_state.json. - Attach a DrawingArea left line-number gutter synchronized with scroll and font metrics, plus current-line and matching bracket highlights preserved across syntax re-colorization. - Add collapsible Find/Replace bar (Ctrl+F, Ctrl+H, F3/Shift+F3, regex/case toggles, atomic Replace All) and Go-to-Line bar (Ctrl+G). - Add auto-indent on Return, multi-line Tab/Shift+Tab indent/outdent, Ctrl+/ line comment toggling, Ctrl+D duplicate line, Ctrl+Shift+K delete line, smart Home, and pair editing. - Route Edit menu Undo/Redo/Select All/Cut/Copy/Paste/Delete and Find/Go-to-Line/Zoom actions to the active TopologyTextEditor in text mode. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
- parser.py, model.py: Isolate TplgClassDef copies via TplgClassDef.clone() before _resolve_pipeline_inheritance(), descend through non-Class conditional blocks in _has_topology_objects(), normalize parser DAI ConfigNode keys, and restore persisted # @sof-builder-manifest metadata. - tplg_binary.py, tplg_ipc4.py: Normalize undecoded zero SOF ABI fields to None, mark extracted git snapshots read-only with is_versioned_snapshot_path(), compare both input/output audio formats in diff_binary_vs_source(), require all structural fingerprint sets and zero param_diffs for is_exact, fix DAI/pipeline DAPM direction hints, and restore decoded gain/src/asrc/component tokens. - serializer.py: Prefer decoded bytes_hex over auto-default included_param_file, support parser-generated Object.PCM.pcm keys and quoted pcm_caps formats/rates, round-trip binary manifest metadata comments, and serialize Object.Dai.* sections. - text_editor.py: Invalidate cached _search_matches immediately on buffer edits and match regex replace_current() against full buffer context for lookbehinds and backreferences. - window.py: Guard Save against overwriting read-only git snapshots, prevent auto source substitution on format mismatches, restore tplg:source:/tplg:bin: tabs via .tplg path and mode, abort exports/compiles when text commit fails, and preserve binary provenance across text commits. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
lgirdwood
force-pushed
the
feat/sof-builder-tplg-text-editor
branch
from
December 3, 2026 13:19
30eb7e6 to
1ebdfff
Compare
lgirdwood
marked this pull request as ready for review
December 3, 2026 20:50
There was a problem hiding this comment.
🟡 Changes recommended
Critical reconstruction and serialization defects can silently lose binary settings, export stale topology, and rebuild tabs using another binary’s workspace and compiler.
13 open issues
Honor full-topology serialization before using the disk-source fast path · New Write manifest metadata in both save paths · New Serialize pin formats from both supported object representations · New Preserve nested pipeline scheduler overrides when parsing · New Refresh include lines after collecting DAI includes · New Avoid source matching when binary component settings differ · New Preserve sample type and interleaving in reconstructed formats · New Correct reversed DAI playback and capture hints · New Preserve all hardware configurations and the selected default · New Restore the correct workspace and compiler when switching tabs · New Compare full audio formats before declaring graphs an exact match Preserve manifest and binary provenance through text round-trips Compile exports asynchronously to avoid freezing the editor · New
13 resolved since last review
Abort export when committing text edits fails Restore source tabs from their original binary topology Restore decoded component parameters when reconstructing widgets Require matching structural sets for exact graph matches Protect snapshots from saves that overwrite cached source files Invalidate cached search matches immediately after edits Include DAI links and configurations in full-topology exports Recognize parser-generated PCM keys during export Prefer decoded private bytes over default parameter includes Isolate class objects during pipeline inheritance resolution Treat undecoded SOF ABI versions as unknown Expand regex replacements using matches from the full buffer Traverse conditional pattern blocks without entering class templates
Review effort: Balanced
- serializer.py, parser.py: Check prefer_full_topology before the disk-source fast path, insert/refresh # @sof-builder-manifest: headers across all save paths without duplicating stale lines, serialize CombineArrays pin audio formats and primitive array elements cleanly, preserve nested Object.Widget.pipeline scheduler settings on reparse, emit DAI default_hw_config_id, and unconditionally refresh DAI includes (SAI/UAOL). - tplg_binary.py: Preserve sample_type and interleaving_style on decoded pin formats, swap reversed DAI_IN/DAI_OUT direction hints, reconstruct all hw_configs alongside default_hw_config_id, and compare gain/SRC/ASRC/kcontrol/bytes-control parameters (and sample_type/interleaving_style) in diff_binary_vs_source(). - window.py: Prevent auto source substitution whenever param_diffs is non-empty, insert/refresh manifest metadata when saving raw text buffers, track and restore resolved workspace/compiler per GraphTabPage, and execute .tplg export compilation asynchronously via GLib.idle_add. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
This draft PR adds binary
.tplgopening/editing with ABI-matched source discovery and upgrades the Topology2 text editor insof-builder:Platform feature
.confparsing &IncludeByKeyexpansion (parser.py,model.py,window.py)dmic-wov-multi.confinstead of empty pipeline containers.Binary
.tplgopening, ABI version matching & full topology export (tplg_ipc4.py,tplg_binary.py,compiler.py,serializer.py,model.py,window.py).tplgmanifest headers andSOF ABIpayloads (IPC4<3H>and IPC3<3B>).topology2checkouts bykernel/abi.hversion and extracts read-only historicalgit archivesnapshots under~/.cache/sof-builder/versioned-sources/when an exact local match is unavailable..conf/ CMake targets with structural & parameter diffs, or decompiles binary pipelines, widgets, routes, kcontrols, and PCMs into an editable graph while preserving decodedsof_abi_byteson recompile.TopologyTextEditor core editing & font controls (
text_editor.py,window.py)SpinButton,Wraptoggle, andCtrl++/Ctrl+-/Ctrl+0/Ctrl+Scrollzoom synced across tabs and persisted inui_state.json.DrawingArealeft line-number gutter, active-line background, and matching/mismatched bracket highlights preserved across syntax re-colorization.Ctrl+F,Ctrl+H,F3/Shift+F3, case/regex toggles, atomicReplace All) and Go-to-Line (Ctrl+G) bars.Tab/Shift+Tab,Ctrl+/line comment toggling,Ctrl+Dduplicate line,Ctrl+Shift+Kdelete line, smartHome, pair typing/backspace, and context-aware Edit menu routing (Undo,Redo,Select All,Cut,Copy,Paste,Delete).Testing
py_compileacross all modified Python modules.3.29.1) & IPC3 (3.22.1) binary version decoding, read-only git-snapshot resolution (3.28.0), andalsatplground-trip recompilation preserving binary ABI bytes.TopologyTextEditorunit checks and headless GTK4Topology2MainWindowintegration tests.