fix(as370): the summary counts statements flagged, not messages (#88) - #92
Merged
Merged
Conversation
IFOX00's ERRORTN (ifnx6b.asm:443) holds LSTMTNO, a single fullword initialised
to -1, and increments ERRQTY only when the statement number differs from the
immediately preceding one:
C COUNT,LSTMTNO IF SAME STATEMENT NUMBER
BE NOCOUNT DON'T COUNT IT AGAIN
So one statement with three diagnostics is one flagged statement. as370 summed
the per-recorder message totals instead: tests/undefsym.s reported 5 where the
oracle's listing says NUMBER OF STATEMENTS FLAGGED = 4, because stmt 10 raises
two of the five IFO188s. A statement caught by two different recorders was
counted twice as well.
cont_stmts() already deduped, for the continuation recorder alone -- which is why
cont72 was right and everything else was not. It is replaced rather than copied:
it counted over contd[]'s KEPT entries, so it under-counted past the print cap.
Both counts now come from bitmaps marked inside the recorders BEFORE their caps.
That closes a live defect in the other ten, which still stop their printed lists
at 128 entries and had no seen-counter at all: 200 over-length operand terms are
200 flagged statements, and the summary said 128, silently. bce38d8 fixed exactly
this for the continuation recorder and noted the others wanted the same
treatment; they get the half that decides the number, without touching their
lists.
Two key spaces, because continuation diagnostics are raised while cards are
joined, before lines[] exists: statements by lines[] index (so a macro
expansion's statements count individually, as IFOX numbers them -- line_org would
fold them all onto the call), continuations by raw card number. They are
reconciled through the origin card, and only when exactly one non-generated
flagged statement carries it: several sharing a card means a COPY'd block or a
macro expansion, where the card no longer names one statement, and over-counting
is the safe direction -- an under-count hides a diagnostic.
One residual, and it is a library-member one: a continuation diagnostic raised
inside a macro library carries a member-relative card number that names no
statement in this numbering, so it is counted on its own even when the statement
it belongs to is flagged as well. Filed as #91 and pinned in run.sh as a tripwire
rather than left to be discovered; closing it needs the origin (member, card) of
every generated line threaded through mexp.
Measured over 835 ecosystem modules: 13 raise a diagnostic at all, none has a
library-member continuation diagnostic (#81 removed the last of them), and the
count changes in two -- irxprobe.asm 208 -> 205, and nsfctcio.asm at 9012263^
15 -> 12, which is #82's DCBD case: five IFO188 over two statements. No deck
moves; the RC is unchanged, and is floored at one flagged statement should a
severity ever be raised without one.
run.sh pins all four properties: the count survives the print cap, one statement
in both spaces counts once, a member-relative card is not merged with a
primary-source one, and the #91 residual.
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.
Closes #88. Splits out #91.
What IFOX00 actually does
ifnx6b.asm:443(ERRORTN) — the line the existingcont_stmts()comment already cited, now read:LSTMTNOis a single fullword, initialised to −1 (SET TO NEG TO COUNT STMT 0 ERR, line 265). So the count is adjacent-dedup over the emission order; because IFOX emits in statement order, that is "distinct statements". as370 prints per recorder, which is not statement order, so a set is the faithful reading — it gives the number IFOX would give for the same set of flagged statements.as370 summed the per-recorder message totals:
tests/undefsym.ssaid 5 where the oracle saysNUMBER OF STATEMENTS FLAGGED = 4, because stmt 10 raises two of the five IFO188s.A live defect closed on the way
cont_stmts()already deduped — for the continuation recorder alone, which is whycont72was right and everything else was not. It is replaced, not copied: it counted overcontd[]'s kept entries, so it under-counted past the print cap.Both counts now come from bitmaps marked inside the recorders before their caps. The other ten still stop their printed lists at 128 with no seen-counter at all:
bce38d8 fixed exactly this for the continuation recorder and noted the others wanted the same treatment. They get the half that decides the number, without touching their lists.
Two key spaces, and why the reconciliation is conservative
Continuation diagnostics are raised while cards are joined, before
lines[]exists. So: statements keyed bylines[]index (a macro expansion's statements count individually, the way IFOX numbers them —line_orgwould fold them all onto the call), continuations keyed by raw card number.They are reconciled through the origin card, and only when exactly one non-generated flagged statement carries it. Several sharing a card means a COPY'd block (whose lines keep the COPY statement's origin) or a macro expansion, where the card no longer names one statement. Over-counting is the safe direction — a count one too high is visible beside the messages; an under-count hides a diagnostic.
That guard is not theoretical. A library member's card 4 and the primary source's card 4 are different statements, and subtracting on the number alone merges them:
Pinned as
flagged_libcard.Measured
835 ecosystem modules (libc370 743, rexx370, ufsd, ftpd, httpd, httplua, httprexx, lua370, mvsmf, lstring370, nsf370, and nsf370 at
9012263^):irxprobe.asm208 → 205,nsfctcio.asm(pre-fix) 15 → 12The 15 → 12 is #82's DCBD case exactly: five IFO188 over two statements.
No deck moves (
corpus: no module moved). The RC is unchanged —errorsis only a boolean for it — and is floored at one flagged statement should a severity ever be raised without one, rather than trusting that it cannot happen.The residual, pinned rather than documented
A continuation diagnostic raised inside a macro library carries a member-relative card number that names no statement in this numbering, so it is counted on its own even when the statement it belongs to is flagged as well:
One generated statement, badly continued and referencing an undefined symbol. IFOX00 counts 1; as370 counts 2.
flagged_libmacasserts the 2 and says in its comment what the right answer is and why — so implementing #91 fails the test and brings whoever does it to the number that has to change. Closing it needs the origin(member, card)of every generated line threaded throughmexp, which is the code #63, #78 and #81 came out of; not worth entering for a cosmetic counter.Tests
undefsymnow asserts the oracle's 4. Four new cases pin the properties:flagged_cap(the count survives the print cap),flagged_overlap(one statement in both spaces counts once),flagged_libcard(a member-relative card is not merged with a primary-source one),flagged_libmac(the #91 tripwire). All four fail againstmainwhere they should.Built warning-clean with real gcc 14.2
-Werroron mvsdev as well as clang.