Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Peter Senna Tschudin <peter.senna@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 0/7] igt: Help out coccinelle
Date: Mon, 24 Nov 2025 23:39:47 +0200	[thread overview]
Message-ID: <aSTQo-enEW5TmAlv@intel.com> (raw)
In-Reply-To: <b1d1fc5f-09d8-4046-b99c-77677a5b2b06@linux.intel.com>

On Mon, Nov 24, 2025 at 07:12:12PM +0100, Peter Senna Tschudin wrote:
> Hi Ville,
> 
> I need to see the value proposition before supporting ~2000 lines of churn.
> 
> - Can you share the specific Coccinelle scripts that require these changes?

It doesn't matter what you want to change or how. Any time cocci sees
eg. igt_fixture or igt_main it barfs and gives up. So currently you
can't do any kind change with coccinelle to most of tests/.

> - What transformations are you planning that can't work with the current
> syntax?

We need to fix the massive pipe vs. crtc mess. And in general
it would be nice to be able to use cocci over the igt codebase.
Currently that is impossible.

> - Have you attempted these transformations and confirmed current syntax
> blocks them?

Of course I tried, How else do you think I could have
even come up with this stuff?

> 
> More importantly: Coccinelle provides mechanisms to handle non-standard
> macros (iterator declarations,

Iterators is exactly what I used. Did you read the
commit messages?

> custom isomorphisms, virtual rules,
> etc.). Have you exhausted all options for teaching Coccinelle about our
> existing macro syntax before concluding we need to modify the codebase
> itself?

"all options" would probably involev rewriting coccinelle. So no, I
haven't exhausted all options. I have spent quite a bit of time with
coccinelle and I'm not aware of any way to teach it about this kind of
non-standard syntax.

If you can pull some kind of rabbit out of your hat please do so,
and stick it into scripts/ so that other people can also use cocci
without spending a month reverse engineering the syntax.

> 
> It seems backwards to change ~2000 code locations to accommodate a tool

It doesn't really matter how many places need changing. It's all
done completely mechanically with sed, so entirely trivial.

> when the tool is designed to be configurable for exactly these situations.

It's designed to consume somewhat standard C. igt is not that.

> 
> Without concrete examples of problems being solved and evidence that
> Coccinelle-side solutions were explored, this looks like speculative
> refactoring with unclear ROI.

If you need to convince yourself then just try to do some kind of
trivial change over all of tests/ and see how far you can get
without this series and its scripts/iterators.cocci.

-- 
Ville Syrjälä
Intel

  parent reply	other threads:[~2025-11-24 21:39 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 19:14 [PATCH i-g-t 0/7] igt: Help out coccinelle Ville Syrjala
2025-11-20 19:14 ` [PATCH i-g-t 1/7] igt: Make igt_fixture look like an iterator Ville Syrjala
2025-12-03 17:26   ` Kamil Konieczny
2025-11-20 19:14 ` [PATCH i-g-t 2/7] igt: Make igt_subtest_group " Ville Syrjala
2025-11-20 19:14 ` [PATCH i-g-t 3/7] igt: Make igt_main look more like a function Ville Syrjala
2025-11-20 19:14 ` [PATCH i-g-t 4/7] igt: Make igt_simple_main " Ville Syrjala
2025-11-20 19:14 ` [PATCH i-g-t 5/7] igt: Make igt_main*() look like normal function definition Ville Syrjala
2025-11-20 19:14 ` [PATCH i-g-t 6/7] igt: Make igt_simple_main*() " Ville Syrjala
2025-11-20 19:14 ` [PATCH i-g-t 7/7] scripts/cocci: Add iterators.cocci Ville Syrjala
2025-11-24 21:49   ` Ville Syrjälä
2025-11-24 22:40     ` Ville Syrjälä
2025-12-04 12:56       ` Hajda, Andrzej
2025-12-09 17:00         ` Ville Syrjälä
2025-11-20 19:51 ` ✓ Xe.CI.BAT: success for igt: Help out coccinelle Patchwork
2025-11-20 20:05 ` ✗ i915.CI.BAT: failure " Patchwork
2025-11-21  0:40 ` ✓ Xe.CI.Full: success " Patchwork
2025-11-24 18:12 ` [PATCH i-g-t 0/7] " Peter Senna Tschudin
2025-11-24 20:57   ` Jani Nikula
2025-11-24 21:37     ` Peter Senna Tschudin
2025-11-24 21:39   ` Ville Syrjälä [this message]
2025-11-24 21:53     ` Peter Senna Tschudin
2025-11-25 13:49   ` Kamil Konieczny
2025-11-25  8:38 ` ✓ Xe.CI.BAT: success for igt: Help out coccinelle (rev2) Patchwork
2025-11-25  9:10 ` ✓ i915.CI.BAT: " Patchwork
2025-11-25 11:55 ` ✗ Xe.CI.Full: failure " Patchwork
2025-11-25 13:44 ` [PATCH i-g-t 0/7] igt: Help out coccinelle Kamil Konieczny
2025-11-25 17:12   ` Ville Syrjälä
2025-11-25 17:53 ` ✗ i915.CI.Full: failure for igt: Help out coccinelle (rev2) Patchwork
2025-12-03 17:38 ` [PATCH i-g-t 0/7] igt: Help out coccinelle Kamil Konieczny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aSTQo-enEW5TmAlv@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=peter.senna@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox