Commit 4737acb
committed
Copy ETA: stop decaying files_rate during long single-file streams
The EWMA on `files_rate` updated on every progress sample, including those where `delta_files == 0` (no file completed). During a long single-file stream (e.g. a 500 MB Pixel video over MTP at ~28 MB/s for 20 s = ~90 samples), the rate decayed by `0.936^90 ≈ 0.001` per step from its last positive value, ending up near `7e-4 files/s`. That made `eta_files = remaining / 7e-4` explode to ~1.4M s, and `max(eta_bytes, eta_files)` then picked the bogus value (a 393 h ETA on a 22 min copy in the user's screenshot).
Fix: only update `state.files_rate` when `delta_files > 0`. Zero-delta samples are "no information about the files axis" (the file is still streaming), not a true zero rate. `state.bytes_rate` is unaffected because bytes flow continuously during streaming.
Preserves the May 2026 174k-tiny-files fix (`big_first_then_small_tail_keeps_eta_alive`): when files complete continuously, every sample has `delta_files > 0` and the EWMA updates normally.
Added `long_single_file_stream_does_not_decay_files_rate_to_zero` regression test: 6 small files → 90 zero-delta samples of one big file. Asserts `eta_seconds < 10_000` and `files_per_second >= 0.1`.1 parent 10a952a commit 4737acb
1 file changed
Lines changed: 90 additions & 1 deletion
Lines changed: 90 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
168 | 178 | | |
169 | 179 | | |
170 | 180 | | |
| |||
398 | 408 | | |
399 | 409 | | |
400 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
401 | 490 | | |
402 | 491 | | |
403 | 492 | | |
| |||
0 commit comments