Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wDhzt-003GWx-0v for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Apr 2026 12:08:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wDhzp-009esL-2A for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Apr 2026 12:08:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wDhzp-009esD-0N for pgsql-hackers@lists.postgresql.org; Fri, 17 Apr 2026 12:08:29 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wDhzm-00000001T7Y-1lYk for pgsql-hackers@postgresql.org; Fri, 17 Apr 2026 12:08:28 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2b24fede2acso3675935ad.3 for ; Fri, 17 Apr 2026 05:08:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776427706; cv=none; d=google.com; s=arc-20240605; b=IzeWwvX6mVSsT0wP94XCrmHQV3uVrCsN/qS85h9Vx+xyxCFbqGy5J1IszRcDamZIqo MhFONi/Mf00L0LMd7mhQsmpb2vhbzO4Ynbq900ogzQGBfNC8v/jfMtZvSu+2xZEVkJM/ H5eVQZkRer7z0h2PP0w2q6OAwmuB21+DGGIuqF5G7jUpXevv4jAZn61QyRbyMxj1Q61Z VNQYJDJmH1qZrpxuA5t3tnxESCJ9WAprnn+Gh7NXSVlUK3t65vHO9OG9dwVlaUECx3gd rCKqQ8cNarW0gCFnBDIfKGCC0MsbDrpjlaiMsBCfoO5jCTDjyuNkHAJgTN5YZ5a4p69y hT+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:dkim-signature; bh=1NF6sgzDkxk285K27IJJftgT24ZzMHTd/Ch7nW5WuYw=; fh=FYgPOGQhrYubDf3iqmopsdLusvJ5GJEN+v5dZ05L1UI=; b=bOyqtnXIX9snTWB2WFxrKtFjo5v3cqsMXF2nnZd3LT4f4nGThQd75ofc5SknKED/lD 72nwQdUea/5iJ05zmeEvAOR2xyo7AAzfW2B4KNcanvNYbtmnaj+vWhKU2Ejoa+T3SSqr VfKv7qphrOuIER9RNIG+rQRQpFyqfBVzfbJFksRuNecoA/h28ZTlol9nYSvMVVDIqGmC 5hunih/8RJl0i1yTlTdyBs20xvbvfpZhu/PNzD77kiZzL48B6KkKrnfqjNXuutgxCccU u9u8a7spGC7XqTRhkiXq1Kq4LUF3YfantbHitP4f5w1f8yO7vKPvUTwzWWtKFLvm6FIL 41fA==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776427706; x=1777032506; darn=postgresql.org; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=1NF6sgzDkxk285K27IJJftgT24ZzMHTd/Ch7nW5WuYw=; b=X37MbgCnXaIei+ap1s0BA57n8INu/NhGOUSD30UN2PNlbpuM3LA6Y2s4s/S+XRhvyc 20a+SWDkAol+iul5Dn58OBBymkxb9P4obe6Py5ARt0c+LhKJzMdYQMgl52iSfrw3mxnU Dr6JtEZol6dlj5wah8Nq9H75fJDOhz/+aQLPJh3FKyiUk/W2pByLO25O4B5G+LlbKEis Ud/uAIxVJvDT/BUROoyYOVffPz0/BMJNyeHclEWaUjOwpKl9XJ8W0XvdJW9RJHYb/kXD vkh/YYqsFJJZcM3qBSZ+osFul/IZSMD8o4p33jeQMWGIGDcc8a9B994AXLQikYe0MxrA 6IIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776427706; x=1777032506; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1NF6sgzDkxk285K27IJJftgT24ZzMHTd/Ch7nW5WuYw=; b=d2Be1eISZtGvaVDeZI/yIof8BVvYefMNh7EdbmbpxO/JUhmLpUizbHJUflGk5IfT4C Kan2y3Mv1A8Pzc87Ah4S1WGYWruj+VCPozCXd4m/r2xTiVaUdlm5IYld4maAPptI+Eae SVjKltRBLOp11fwwnbFMmGYJuA4DPuYQM2GmaelPHcDOIuMUvwcP75agkY5xniH91hkR fTUL8ll0MymE+XQZmF1GnVXmZ/dwOW2+eNIHakXjWRnEShrz+hL23EiY02y7H17KqsxK 7wtmvRmody0Vvijx+ZfEjWqEguiDg7Jb9pPRPL/Ur4jJaSXbsboCPNr3a0k7lZjaGGlS YCXg== X-Forwarded-Encrypted: i=1; AFNElJ9iQPMLS5+wDO8vOEPZXDR7oAxdTShiqV3Fmn+f4M/LGdnZdegRWcVHbZ2TeS4wja+Y5VS25f1pabtr176r@postgresql.org X-Gm-Message-State: AOJu0YyozYBkFsXVIRWvw4y9CJ2DRf2CTdPDiq3YIV5UlyTvN3CFxyBT Ia2/+NZg2yS2Lb6/2/veAnTBH0SpPcvJqnTnuKwIL2x/GrXREldEkIx+2m2iapbL7t50AjlNKhU UKXCwx5WXE7eNV0Jfh4CxqwyZ14ImVWY= X-Gm-Gg: AeBDietzVUneXlaWQzdQLcw9C6T4GIwc9yXb8klvcGVRyYNXL5d1c67creIxPGTNPDv F1+yYSWHUYNGjhcXxbA4oppdq0DLYicenq8e/qbpy9lJVo9TQFHO05SlZejAFV04XEYLbUYrK8P gF7STlhf2q7Ba1sqokXsAr73GIdE9thzCqGBkFHbokMqW9F7q/YtxlMl45xr62PTGwEO8jyg4QL WjaLhEI10pqHnuy5sH0Xn+HL5szibA0DdXGMqUH/BIyWUqYiPiu+UVOMZI1br/u+9NwFeaBQx8s AGKpQYHEnYQeRhvkzQNUU1HLHB3nzvUAjd/RemYzRVLmekRDz4PWHsCVkCiQzw== X-Received: by 2002:a17:902:e747:b0:2b2:4fc1:f657 with SMTP id d9443c01a7336-2b5f9e8d865mr28745825ad.6.1776427705734; Fri, 17 Apr 2026 05:08:25 -0700 (PDT) MIME-Version: 1.0 References: <20260410.183515.1561517749674643173.ishii@postgresql.org> <20260417.171022.397021509290810631.ishii@postgresql.org> <20260417.191303.359804214243525887.ishii@postgresql.org> In-Reply-To: <20260417.191303.359804214243525887.ishii@postgresql.org> Reply-To: assam258@gmail.com From: Henson Choi Date: Fri, 17 Apr 2026 21:08:12 +0900 X-Gm-Features: AQROBzBQPYmOzm_5arPVQ8-vsrzJhckxRAnghSkTKleBAQIvxkEPlKOy478p02A Message-ID: Subject: Re: Row pattern recognition To: Tatsuo Ishii Cc: zsolt.parragi@percona.com, sjjang112233@gmail.com, vik@postgresfriends.org, er@xs4all.nl, jacob.champion@enterprisedb.com, david.g.johnston@gmail.com, peter@eisentraut.org, pgsql-hackers@postgresql.org Content-Type: multipart/alternative; boundary="0000000000005e9b98064fa6ce76" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005e9b98064fa6ce76 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Tatsuo, Thank you for the feedback. Note that applying 0001-0006 produced compiler warning. > > execExprInterp.c: In function =E2=80=98ExecEvalRPRNavSet=E2=80=99: > execExprInterp.c:6005:23: warning: =E2=80=98target_pos=E2=80=99 may be us= ed uninitialized > [-Wmaybe-uninitialized] > 6005 | target_slot =3D ExecRPRNavGetSlot(winstate, target_pos); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > execExprInterp.c:5959:25: note: =E2=80=98target_pos=E2=80=99 was declared= here > 5959 | int64 target_pos; > | ^~~~~~~~~~ > `ExecRPRNavGetSlot()`, along with the enclosing `ExecEvalRPRNavSet()` and its `int64 target_pos` declaration, is introduced by nocfbot-0017 (Implement 1-slot PREV/NEXT navigation for RPR), not at the 0001-0006 level. Could you double-check the actual applied range on your side? The function simply does not exist at 0001-0006. Since the function is not present at 0001-0006, I suspect the applied patch set on your side is in a different state than expected. Could you verify the range and contents of the patches actually applied? But regression test was ok. > However, after applying 0007, regression test failed. > > not ok 196 + rpr_integration 514 ms > # (test process exited with exit code 2) > nocfbot-0006 was written specifically to prevent the crashes that 0007's tests expose, so with 0001-0007 applied in order the issue should already be resolved. On my authoritative base (cfbot/4460) all rpr_integration tests pass through 0008. I had been routinely building only on macOS ARM64 recently, so I just re-verified on Rocky 9 and Ubuntu 24 AMD64 as well; no build warning and no rpr_integration failure on either. For reference, here is my working tree layout. Titles only for my post-base commits (hashes on my side won't match yours); base hashes are public and directly comparable on your side: [post-base, newest first] 31. Remove unused include and fix header ordering in RPR files (origin/RPR) 30. Add inline comments for complex RPR algorithms and design notes 29. Fix nav_slot pass-by-ref dangling pointer in RPR navigation 28. Fix RPR documentation: synopsis, grammar, and terminology 27. Fix comment typos, grammar, and inaccuracies in RPR code 26. Fix RPR error message style: hint format, terminology, capitalizatio= n 25. Guard against int64 overflow in RPR bounded frame end computation 24. Implement FIRST/LAST and compound navigation for RPR 23. Add Nav Mark Lookback to EXPLAIN and fix compute_nav_max_offset() 22. Add 2-arg PREV/NEXT test for row pattern navigation with host variable 21. Enable JIT compilation for PREV/NEXT navigation tests in RPR 20. Update RPR code comments to reflect 1-slot navigation model 19. Add tuplestore trim optimization for RPR PREV navigation 18. Add JIT compilation support for RPR PREV/NEXT navigation 17. Implement 1-slot PREV/NEXT navigation for RPR 16. Normalize RPR element flag macros to return bool 15. Narrow variable scope in ExecInitWindowAgg DEFINE clause loop 14. Add CHECK_FOR_INTERRUPTS to RPR context cleanup and finalize loops 13. Remove unused force_colno parameter from RPR deparse functions 12. Fix execRPR.o ordering in executor Makefile to match meson.build 11. Fix quote_identifier() for RPR pattern variable name deparse 10. Rename rpr_explain test views from sequential numbers to descriptive names 9. Add fixed-length group absorption for RPR 8. Replace reduced frame map with single match result 7. Add RPR planner integration tests 6. Fix DEFINE expression handling in RPR window planning 5. Fix mark handling for last_value() under RPR 4. Fix in-place modification of defineClause TargetEntry in setrefs.c 3. Add CHECK_FOR_INTERRUPTS() to nfa_try_absorb_context() loop 2. Add CHECK_FOR_INTERRUPTS() to nfa_add_state_unique() for state explosion patterns 1. Remove unused regex/regex.h include from nodeWindowAgg.c [base, public hashes] 732acf9b7c6 (cfbot/cf/4460) [CF 4460] v46 - Implement row pattern recognition feature 6eb8841afaf Row pattern recognition patch (typedefs.list). 5213dbb3c4f Row pattern recognition patch (tests: expected). bdc3a17982b Row pattern recognition patch (tests: SQL, data). 596bcc434b5 Row pattern recognition patch (docs). e02872fd59c Row pattern recognition patch (executor and commands). 742c6eb673e Row pattern recognition patch (planner). 8514ca64f2d Row pattern recognition patch (rewriter). d26741d4f1d Row pattern recognition patch (parse/analysis). f85d2ee8f4a Row pattern recognition patch for raw parser. e484b0eea61 (origin/RPR-base, RPR-base) Fix two issues in fast-path FK check introduced by commit 2da86c1ef9 Could you send me the equivalent `git log` for your working tree covering the full v46 application and the commit immediately preceding it? In particular, could you also check whether the recent master commit titled "Fix integer overflow in nodeWindowAgg.c" (backpatched to 14) is included in your base? It touches the same ROWS/GROUPS frame boundary code path that RPR interacts with, so its presence or absence will help narrow things down. Once I can match the same base locally, I will reproduce and include the fix in the next revision. A quick status update: - nocfbot-0006: self-review complete, not yet sent (comment tweak per review) - nocfbot-0007: under self-review (comment details per review) - nocfbot-0008: in progress I would like to resolve the crash first before sending the next revision, so that the full set goes out together once our bases are aligned and A3 passes on your side. One process question: so far I have been folding review feedback into the relevant existing patches (i.e. amending nocfbot-0008 to reflect your comments on it). Would you prefer that I instead append the review fixes as new patches at the end of the series (e.g. nocfbot-0032, 0033, ...), so the history of reviewed changes stays visible? Happy to follow whichever workflow you find easier to review. Regards, Henson --0000000000005e9b98064fa6ce76 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Tatsuo,

Thank you for the feedback.

Note that applying 000= 1-0006 produced compiler warning.

execExprInterp.c: In function =E2=80=98ExecEvalRPRNavSet=E2=80=99:
execExprInterp.c:6005:23: warning: =E2=80=98target_pos=E2=80=99 may be used= uninitialized [-Wmaybe-uninitialized]
=C2=A06005 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0target_slot =3D ExecRPRNavGet= Slot(winstate, target_pos);
=C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
execExprInterp.c:5959:25: note: =E2=80=98target_pos=E2=80=99 was declared h= ere
=C2=A05959 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int64=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0target_pos;
=C2=A0 =C2=A0 =C2=A0 |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^~~~~~~~~~
=C2= =A0
`ExecRPRNavGetSlot()`, along with the enclosing `ExecEvalRPRN= avSet()`
and its `int64 target_pos` declaration, is introduced by nocfbo= t-0017
(Implement 1-slot PREV/NEXT navigation for RPR), not at the 0001-= 0006
level.=C2=A0 Could you double-check the actual applied range on you= r side?
The function simply does not exist at 0001-0006.

Since th= e function is not present at 0001-0006, I suspect the
applied patch set = on your side is in a different state than
expected.=C2=A0 Could you veri= fy the range and contents of the patches
actually applied?

But regression test was ok.
However, after applying 0007, regression test failed.

not ok 196=C2=A0 =C2=A0+ rpr_integration=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0514 ms
# (test process exited with exit code 2)

nocfbot-0= 006 was written specifically to prevent the crashes that
0007's test= s expose, so with 0001-0007 applied in order the issue
should already be= resolved.=C2=A0 On my authoritative base (cfbot/4460) all
rpr_integrati= on tests pass through 0008.=C2=A0 I had been routinely
building only on = macOS ARM64 recently, so I just re-verified on
Rocky 9 and Ubuntu 24 AMD= 64 as well; no build warning and no
rpr_integration failure on either.
For reference, here is my working tree layout.=C2=A0 Titles only for = my
post-base commits (hashes on my side won't match yours); base
= hashes are public and directly comparable on your side:

=C2=A0 [post= -base, newest first]
=C2=A0 =C2=A031. Remove unused include and fix head= er ordering in RPR files =C2=A0 (origin/RPR)
=C2=A0 =C2=A030. Add inline= comments for complex RPR algorithms and design notes
=C2=A0 =C2=A029. F= ix nav_slot pass-by-ref dangling pointer in RPR navigation
=C2=A0 =C2=A0= 28. Fix RPR documentation: synopsis, grammar, and terminology
=C2=A0 =C2= =A027. Fix comment typos, grammar, and inaccuracies in RPR code
=C2=A0 = =C2=A026. Fix RPR error message style: hint format, terminology, capitaliza= tion
=C2=A0 =C2=A025. Guard against int64 overflow in RPR bounded frame = end computation
=C2=A0 =C2=A024. Implement FIRST/LAST and compound navig= ation for RPR
=C2=A0 =C2=A023. Add Nav Mark Lookback to EXPLAIN and fix = compute_nav_max_offset()
=C2=A0 =C2=A022. Add 2-arg PREV/NEXT test for r= ow pattern navigation with host variable
=C2=A0 =C2=A021. Enable JIT com= pilation for PREV/NEXT navigation tests in RPR
=C2=A0 =C2=A020. Update R= PR code comments to reflect 1-slot navigation model
=C2=A0 =C2=A019. Add= tuplestore trim optimization for RPR PREV navigation
=C2=A0 =C2=A018. A= dd JIT compilation support for RPR PREV/NEXT navigation
=C2=A0 =C2=A017.= Implement 1-slot PREV/NEXT navigation for RPR
=C2=A0 =C2=A016. Normaliz= e RPR element flag macros to return bool
=C2=A0 =C2=A015. Narrow variabl= e scope in ExecInitWindowAgg DEFINE clause loop
=C2=A0 =C2=A014. Add CHE= CK_FOR_INTERRUPTS to RPR context cleanup and finalize loops
=C2=A0 =C2= =A013. Remove unused force_colno parameter from RPR deparse functions
= =C2=A0 =C2=A012. Fix execRPR.o ordering in executor Makefile to match meson= .build
=C2=A0 =C2=A011. Fix quote_identifier() for RPR pattern variable = name deparse
=C2=A0 =C2=A010. Rename rpr_explain test views from sequent= ial numbers to descriptive names
=C2=A0 =C2=A0 9. Add fixed-length group= absorption for RPR
=C2=A0 =C2=A0 8. Replace reduced frame map with sing= le match result
=C2=A0 =C2=A0 7. Add RPR planner integration tests
= =C2=A0 =C2=A0 6. Fix DEFINE expression handling in RPR window planning
= =C2=A0 =C2=A0 5. Fix mark handling for last_value() under RPR
=C2=A0 =C2= =A0 4. Fix in-place modification of defineClause TargetEntry in setrefs.c=C2=A0 =C2=A0 3. Add CHECK_FOR_INTERRUPTS() to nfa_try_absorb_context() l= oop
=C2=A0 =C2=A0 2. Add CHECK_FOR_INTERRUPTS() to nfa_add_state_unique(= ) for state explosion patterns
=C2=A0 =C2=A0 1. Remove unused regex/rege= x.h include from nodeWindowAgg.c

=C2=A0 [base, public hashes]
=C2= =A0 732acf9b7c6 (cfbot/cf/4460) [CF 4460] v46 - Implement row pattern recog= nition feature
=C2=A0 6eb8841afaf Row pattern recognition patch (typedef= s.list).
=C2=A0 5213dbb3c4f Row pattern recognition patch (tests: expect= ed).
=C2=A0 bdc3a17982b Row pattern recognition patch (tests: SQL, data)= .
=C2=A0 596bcc434b5 Row pattern recognition patch (docs).
=C2=A0 e02= 872fd59c Row pattern recognition patch (executor and commands).
=C2=A0 7= 42c6eb673e Row pattern recognition patch (planner).
=C2=A0 8514ca64f2d R= ow pattern recognition patch (rewriter).
=C2=A0 d26741d4f1d Row pattern = recognition patch (parse/analysis).
=C2=A0 f85d2ee8f4a Row pattern recog= nition patch for raw parser.
=C2=A0 e484b0eea61 (origin/RPR-base, RPR-ba= se) Fix two issues in fast-path FK check introduced by commit 2da86c1ef9
Could you send me the equivalent `git log` for your working tree
co= vering the full v46 application and the commit immediately
preceding it?= =C2=A0 In particular, could you also check whether the
recent master com= mit titled "Fix integer overflow in
nodeWindowAgg.c" (backpatc= hed to 14) is included in your base?=C2=A0 It
touches the same ROWS/GROU= PS frame boundary code path that RPR
interacts with, so its presence or = absence will help narrow things
down.=C2=A0 Once I can match the same ba= se locally, I will reproduce and
include the fix in the next revision.
A quick status update:

=C2=A0 - nocfbot-0006: self-review comp= lete, not yet sent (comment tweak per review)
=C2=A0 - nocfbot-0007: und= er self-review (comment details per review)
=C2=A0 - nocfbot-0008: in pr= ogress

I would like to resolve the crash first before sending the ne= xt
revision, so that the full set goes out together once our bases arealigned and A3 passes on your side.

One process question: so far I= have been folding review feedback
into the relevant existing patches (i= .e. amending nocfbot-0008 to
reflect your comments on it).=C2=A0 Would y= ou prefer that I instead
append the review fixes as new patches at the e= nd of the series
(e.g. nocfbot-0032, 0033, ...), so the history of revie= wed changes
stays visible?=C2=A0 Happy to follow whichever workflow you = find easier
to review.

Regards,
Henson
--0000000000005e9b98064fa6ce76--