Skip to content

feat(generator): wire --debug=GENR producer emissions (3.4.1 parity)#4110

Merged
oferchen merged 2 commits into
masterfrom
feat/debug-genr-emissions-2186
May 15, 2026
Merged

feat(generator): wire --debug=GENR producer emissions (3.4.1 parity)#4110
oferchen merged 2 commits into
masterfrom
feat/debug-genr-emissions-2186

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • Wires --debug=GENR to emit the seven upstream rsync 3.4.1 diagnostics from generator.c (recv_generator, generator starting pid, generate_files phase, generate_files finished).
  • Emissions go through debug_log!(Genr, 1, ...) at the receiver-side transfer entry (setup_transfer), the per-file recv_generator analog (build_files_to_transfer), and the phase ladder (exchange_phase_done / finalize_transfer).
  • Per-file emission is gated behind debug_gte so the loop is skipped entirely when the flag is off.
  • The non-inc_recurse phase loop emits at each phase++, matching upstream lines 2356/2367/2393. The inc_recurse branch emits three times when supports_multi_phase is true (protocol >= 30, which inc_recurse already requires).
  • Audit doc rolls GENR from missing to impl and marks G8 RESOLVED.

Closes #2186.

Test plan

  • CI fmt+clippy passes
  • CI nextest (stable) passes the new genr_debug_emission_tests module (5 tests)
  • Windows / macOS / Linux musl matrices green

oferchen added 2 commits May 16, 2026 01:51
The audit (G8 in debug-flags-verbosity-matrix.md) flagged GENR as
having no producers - the flag table accepted `--debug=GENR` and the
bridge mapped `rsync::generator` to it, but no emission site fired.

Upstream rsync 3.4.1 emits seven GENR-gated diagnostics from
generator.c under DEBUG_GTE(GENR, 1):

- recv_generator(%s,%d) (generator.c:1234-1235)
- generator starting pid=%d (generator.c:2260-2261)
- generate_files phase=%d (generator.c:2355-2357, 2366-2368, 2392-2394)
- generate_files finished (generator.c:2436-2437)

oc-rsync's receiver-side transfer is the closest analog to upstream's
generate_files: it routes every run* entry through setup_transfer
(generator starting), drives recv_generator-equivalent quick-check via
build_files_to_transfer (per-file recv_generator), and runs the phase
ladder in exchange_phase_done / finalize_transfer. This wires
debug_log!(Genr, 1, ...) at each of those points.

The per-file emission is gated behind debug_gte so the loop is skipped
entirely when --debug=GENR is off. The non-inc_recurse phase loop emits
once per phase++ (matches upstream lines 2356, 2367, 2393), and the
inc_recurse branch emits three times when supports_multi_phase is true
(protocol >= 30, which inc_recurse already requires).

Five unit tests assert byte-for-byte wording for each upstream message
plus a suppression check confirming emissions are gated by debug.genr.
The audit doc rolls GENR from missing to impl and marks G8 RESOLVED.

Closes #2186.
@github-actions github-actions Bot added the enhancement New feature or request label May 15, 2026
@oferchen oferchen merged commit 1a214f1 into master May 15, 2026
44 of 45 checks passed
@oferchen oferchen deleted the feat/debug-genr-emissions-2186 branch May 15, 2026 23:26
oferchen added a commit that referenced this pull request May 18, 2026
…4110)

* feat(generator): wire --debug=GENR producer emissions (3.4.1 parity)

The audit (G8 in debug-flags-verbosity-matrix.md) flagged GENR as
having no producers - the flag table accepted `--debug=GENR` and the
bridge mapped `rsync::generator` to it, but no emission site fired.

Upstream rsync 3.4.1 emits seven GENR-gated diagnostics from
generator.c under DEBUG_GTE(GENR, 1):

- recv_generator(%s,%d) (generator.c:1234-1235)
- generator starting pid=%d (generator.c:2260-2261)
- generate_files phase=%d (generator.c:2355-2357, 2366-2368, 2392-2394)
- generate_files finished (generator.c:2436-2437)

oc-rsync's receiver-side transfer is the closest analog to upstream's
generate_files: it routes every run* entry through setup_transfer
(generator starting), drives recv_generator-equivalent quick-check via
build_files_to_transfer (per-file recv_generator), and runs the phase
ladder in exchange_phase_done / finalize_transfer. This wires
debug_log!(Genr, 1, ...) at each of those points.

The per-file emission is gated behind debug_gte so the loop is skipped
entirely when --debug=GENR is off. The non-inc_recurse phase loop emits
once per phase++ (matches upstream lines 2356, 2367, 2393), and the
inc_recurse branch emits three times when supports_multi_phase is true
(protocol >= 30, which inc_recurse already requires).

Five unit tests assert byte-for-byte wording for each upstream message
plus a suppression check confirming emissions are gated by debug.genr.
The audit doc rolls GENR from missing to impl and marks G8 RESOLVED.

Closes #2186.

* style: cargo fmt
oferchen added a commit that referenced this pull request May 18, 2026
…4110)

* feat(generator): wire --debug=GENR producer emissions (3.4.1 parity)

The audit (G8 in debug-flags-verbosity-matrix.md) flagged GENR as
having no producers - the flag table accepted `--debug=GENR` and the
bridge mapped `rsync::generator` to it, but no emission site fired.

Upstream rsync 3.4.1 emits seven GENR-gated diagnostics from
generator.c under DEBUG_GTE(GENR, 1):

- recv_generator(%s,%d) (generator.c:1234-1235)
- generator starting pid=%d (generator.c:2260-2261)
- generate_files phase=%d (generator.c:2355-2357, 2366-2368, 2392-2394)
- generate_files finished (generator.c:2436-2437)

oc-rsync's receiver-side transfer is the closest analog to upstream's
generate_files: it routes every run* entry through setup_transfer
(generator starting), drives recv_generator-equivalent quick-check via
build_files_to_transfer (per-file recv_generator), and runs the phase
ladder in exchange_phase_done / finalize_transfer. This wires
debug_log!(Genr, 1, ...) at each of those points.

The per-file emission is gated behind debug_gte so the loop is skipped
entirely when --debug=GENR is off. The non-inc_recurse phase loop emits
once per phase++ (matches upstream lines 2356, 2367, 2393), and the
inc_recurse branch emits three times when supports_multi_phase is true
(protocol >= 30, which inc_recurse already requires).

Five unit tests assert byte-for-byte wording for each upstream message
plus a suppression check confirming emissions are gated by debug.genr.
The audit doc rolls GENR from missing to impl and marks G8 RESOLVED.

Closes #2186.

* style: cargo fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant