Re: Row pattern recognition

From: Henson Choi <assam258(at)gmail(dot)com>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>, jian(dot)universality(at)gmail(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org, zsolt(dot)parragi(at)percona(dot)com, sjjang112233(at)gmail(dot)com, vik(at)postgresfriends(dot)org, er(at)xs4all(dot)nl, jacob(dot)champion(at)enterprisedb(dot)com, david(dot)g(dot)johnston(at)gmail(dot)com, peter(at)eisentraut(dot)org, li(dot)evan(dot)chao(at)gmail(dot)com
Subject: Re: Row pattern recognition
Date: 2026-06-23 14:28:18
Message-ID: CAAAe_zADXbf9aGu-54RTRJPhxYmA1gb_8GV94Q0gAftfv79pjA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

Following up on the coverage analysis I posted earlier: I've since pushed
the
work it proposed, so please find attached (coverage.tgz) an updated report
that
reflects the committed changes. In short, the branch now lands at the
target we
discussed.

* What changed since the first report
- New commits add the row pattern recognition coverage tests for the
reachable
lines, and tidy up the unreachable defensive/dead code (Assert
conversions,
removing the dead _equalRPRPattern body, and similar).
- This is essentially the (b) path from the earlier mail: add the
reachable-line
tests plus the safe cleanups, while keeping the idiomatic guards as-is.

* Measurement setup
- Target: PostgreSQL RPR branch, modified-lines basis (RPR-base..RPR diff)
- Build: gcc --enable-coverage with --with-llvm (LLVM JIT module included;
both C and C++ instrumented)
- Tests: make check-world (regression + TAP + contrib; no forced JIT
settings)

* Results (vs. the first report)
- Modified-line coverage: 96.5% (2,608 / 2,702) -> 98.4% (2,635 / 2,679)
- Functions: 99.4% (172 / 173) -> 100% (170 / 170)
- Remaining 44 uncovered lines are the idiomatic defensive guards we agreed
to
keep on purpose:
- enum-default branches
- pg_unreachable()
- public windowapi.h relpos guards
I left these untouched rather than reworking them to chase ~100%, which
matches my earlier inclination and our reading of where the line should
sit.

* On the earlier caveat
The first report flagged that the reachable/unreachable classification was
AI-assisted and might be wrong. That is now resolved in practice: each line
I
claimed was coverable was verified against a coverage build as I wrote its
test,
rather than resting on the classification.

* What the report contains
Each uncovered line carries a collapsible box stating:
- Reachable / Unreachable classification + confidence
- Reachable: the concrete SQL test that covers it
- Unreachable: the reason it cannot execute, and the recommended source
change
Consecutive lines on the same straight-line flow (no branch in between) are
merged into one box.

* How to view
tar xzf coverage.tgz
# open coverage/index.html in a browser
# -> pick a file -> expand the collapsible box under each red
(uncovered) line

* Contents
- coverage/index.html : per-file coverage overview
- coverage/html/ : per-file detail (source + uncovered-line analysis)
- coverage/untested.md : checklist of uncovered lines

Please review. Feel free to reply with any questions.

Best regards,
Henson

Attachment Content-Type Size
nocfbot-coverage.tgz application/x-gzip 479.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Henson Choi 2026-06-23 14:28:39 Re: Row pattern recognition
Previous Message Tom Lane 2026-06-23 14:12:14 Re: for loop variable fixes