darner census: total the images column in the summary row #611

Open
qnjk wants to merge 1 commit from qnjk/Darner:census-images-total into Main
Contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

  • The problem on main: darner census prints a table whose last column, images, says how many images use each import, and the table ends without a total (apps/darner/src/census.rs:119). A reader cannot tell whether the column is a per-import count that should be totalled, nor reconcile it with the "N images scanned" line above — those are two different numbers, and neither said so.

  • This change adds the TOTAL row's fifth cell: the sum of the per-DLL images column, i.e. the number of (DLL, image) import links — which is at least the scanned-image count, and a comment in the code now says so, so the two numbers are not read as a contradiction.

How it was tested

  • Tested revision: cd51e06 (one commit on c8258f9).
  • Commands and results:
    • cargo test --locked -p darner — 208 passed in the bin, plus the crate's 2 + 3 + 8 integration tests.
    • New integration test census_totals_the_images_column (apps/darner/tests/census.rs): it scans the CLI's own binary (a real PE32+, the same precedent darner-pe's parses_own_test_binary uses), asserts the TOTAL row has five cells, and that the fifth equals the sum of the data rows' last cells — so a wrong total fails, not only a missing one. No title, no fixture.
    • Fail-before, with the old census.rs:
      census_totals_the_images_column ... FAILED
      assertion `left == right` failed: TOTAL must show five columns: "TOTAL ... 437 39 250 148"
        left: 4, right: 5
      
    • cargo clippy --locked -p darner --all-targets -- -D warnings passes.
  • Changes a default: no. One cell of one report line changes, from absent to the sum the column already implies.
  • A/B result: not applicable — no default changes and no speed claim.
  • Gates run on that revision:
    • Gate 1, cargo clippy --workspace --all-targets --locked -- -D warnings: passes.
    • Gate 2, cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.
    • Gate 3, cargo test --workspace --locked: not run to completion here; the pre-existing darner-gpu test deadlock (#224) and darner-shader waterfall fixture failure (#227) make the whole-workspace run non-green on this machine. darner's suite is green.
  • Gameplay, when relevant: not applicable — this is the offline census command.
  • Shader wave sizes tested, when relevant: not applicable.
  • Hardware dependence: none.
  • Coverage gaps: the test scans one binary (the test's own); a directory of many images is exercised by hand only, and the --missing listing is untouched.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
    • Not applicable: darner census is an offline command; the change cannot alter a run.
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md (cargo xtask policy: 576 files ok).
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found. No open pull request changes apps/darner/src/census.rs or apps/darner/tests/census.rs (checked against the file list of all 189 open pull requests). PR #330 (merged) changed only the --missing detail collector, which this does not touch.
  • Replaces or overlaps: none found
## Contributor role (optional) - Fluxer ID: ## What it changes - The problem on main: `darner census` prints a table whose last column, `images`, says how many images use each import, and the table ends without a total (`apps/darner/src/census.rs:119`). A reader cannot tell whether the column is a per-import count that should be totalled, nor reconcile it with the "N images scanned" line above — those are two different numbers, and neither said so. - This change adds the `TOTAL` row's fifth cell: the sum of the per-DLL `images` column, i.e. the number of (DLL, image) import links — which is at least the scanned-image count, and a comment in the code now says so, so the two numbers are not read as a contradiction. ## How it was tested - Tested revision: `cd51e06` (one commit on `c8258f9`). - Commands and results: - `cargo test --locked -p darner` — 208 passed in the bin, plus the crate's 2 + 3 + 8 integration tests. - New integration test `census_totals_the_images_column` (`apps/darner/tests/census.rs`): it scans the CLI's own binary (a real PE32+, the same precedent `darner-pe`'s `parses_own_test_binary` uses), asserts the `TOTAL` row has five cells, and that the fifth equals the sum of the data rows' last cells — so a *wrong* total fails, not only a missing one. No title, no fixture. - Fail-before, with the old census.rs: ``` census_totals_the_images_column ... FAILED assertion `left == right` failed: TOTAL must show five columns: "TOTAL ... 437 39 250 148" left: 4, right: 5 ``` - `cargo clippy --locked -p darner --all-targets -- -D warnings` passes. - Changes a default: no. One cell of one report line changes, from absent to the sum the column already implies. - A/B result: not applicable — no default changes and no speed claim. - Gates run on that revision: - Gate 1, `cargo clippy --workspace --all-targets --locked -- -D warnings`: passes. - Gate 2, `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: passes. - Gate 3, `cargo test --workspace --locked`: not run to completion here; the pre-existing `darner-gpu` test deadlock (#224) and `darner-shader` waterfall fixture failure (#227) make the whole-workspace run non-green on this machine. `darner`'s suite is green. - Gameplay, when relevant: not applicable — this is the offline `census` command. - Shader wave sizes tested, when relevant: not applicable. - Hardware dependence: none. - Coverage gaps: the test scans one binary (the test's own); a directory of many images is exercised by hand only, and the `--missing` listing is untouched. ## Checklist - [x] I ran this change in the game, or say below why it can't be (docs, tests only). - Not applicable: `darner census` is an offline command; the change cannot alter a run. - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md` (`cargo xtask policy`: 576 files ok). - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found. No open pull request changes `apps/darner/src/census.rs` or `apps/darner/tests/census.rs` (checked against the file list of all 189 open pull requests). PR #330 (merged) changed only the `--missing` detail collector, which this does not touch. - Replaces or overlaps: none found
Every per-DLL row prints five numbers, but the TOTAL row printed four: the
`images` cell (how many images import that DLL) was accumulated per row and
then dropped, so the table's last column had no total and a reader could not
reconcile it with the "N images scanned" line above. The column is summed
with the other four now; it counts (DLL, image) pairs, which is at least the
images scanned, and a comment says so. The integration test scans the CLI's
own binary, checks that TOTAL carries five cells, and checks that its last
cell is the column's sum.
TrustNo1 changed title from [pr-fix] darner census: total the images column in the summary row to darner census: total the images column in the summary row 2026-12-06 03:26:17 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'census-images-total:qnjk-census-images-total'
git switch 'qnjk-census-images-total'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'Main'
git merge --no-ff 'qnjk-census-images-total'
git switch 'qnjk-census-images-total'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'qnjk-census-images-total'
git switch 'qnjk-census-images-total'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'qnjk-census-images-total'
git switch 'Main'
git merge --squash 'qnjk-census-images-total'
git switch 'Main'
git merge --ff-only 'qnjk-census-images-total'
git switch 'Main'
git merge 'qnjk-census-images-total'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!611
No description provided.