Files
RedBear-OS/local/recipes/dev/libclc/source/llvm/utils/TableGen/jupyter
vasilito cb424d7448 build: static patch-sanity linter (shift-left the malformed-patch class)
verify-patch-sanity.py validates every active recipe .patch has internally-
consistent hunk line counts — catching the 'malformed patch at line N' failure
at commit/CI/preflight time instead of hours into a cook. This cycle hit that
class three times (qtwaylandscanner, sddm, xwayland), each only discovered when
cookbook tried to apply the patch.

Running it across the repo found 29 latent malformed patches (validated against
GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22').
They were harmless only because they sit in vendored recipes (baked, not re-
applied) — but would fail on any version-bump re-derivation. --fix recounts the
hunk headers (body untouched) and repaired all 29.

Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test
(test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats
(empty placeholders, bare-@@ git hunks).
2026-08-01 05:13:02 +03:00
..

Jupyter Tools for TableGen

This folder contains notebooks relating to TableGen and a Jupyter kernel for TableGen.

Notebooks

LLVM_TableGen.ipynb - A demo of the kernel's capabilities.

tablegen_tutorial_part_1.ipynb - A tutorial on the TableGen language.

sql_query_backend.ipynb - How to write a backend using JSON output and Python.

Notebooks can be viewed in browser on Github or downloaded and run locally. If that is not possible, there are Markdown versions next to the notebook files.

TableGen Kernel

To use the kernel, first install it into jupyter.

If you have installed Jupyter into a virtual environment, adjust python3 to be the interpreter for that environment. This will ensure that tools run the kernel in the correct context.

    python3 -m tablegen_kernel.install

If you are going to open the notebook in an IDE like Visual Studio Code, you should restart it now so that it will find the newly installed kernel.

Then run one of:

    jupyter notebook
    # Then in the notebook interface, select 'LLVM TableGen' from the 'New' menu.

    # To run the example notebook in this folder.
    jupyter notebook LLVM_TableGen.ipynb

    # To use the kernel from the command line.
    jupyter console --kernel tablegen

Or open the notebook in a tool with built in Jupyter support.

llvm-tblgen is expected to be either in the PATH or you can set the environment variable LLVM_TBLGEN_EXECUTABLE to point to it directly.

If you see an error like this:

  Cell In[8], line 2
    // This is some tablegen
    ^
SyntaxError: invalid syntax

You are probably running the notebook using the iPython kernel. Make sure you have selected the tablegen kernel.

To run the kernel's doctests do:

    python3 tablegen_kernel/kernel.py