Repository navigation
Conversation
…lone, not its even share Sessions that start between the same two usage readings share the rise of the account rate evenly, and the estimate never changed again. When all but one of them stopped, the one left was still shown and charged its share, although the account rate was then its own and the app already recorded it for the new-session form. A session that is the account's only runtime now takes the account rate for its estimate, once that rate has moved after the last runtime came or went and then held for two minutes. A rate that moves again with nothing coming or going takes the measurement back. Every other estimate is worked out as before.
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Sessions that start between the same two usage readings share the rise of the account rate evenly, and that estimate never changes again. An A100 (11.77 CU/h) and a T4 (1.76 CU/h) that start together are 6.765 each. After the A100 stops, the account rate is the T4's own, and the app already records it every reading as the T4's measured rate for the new-session form. The card and the spend limit still used 6.765.
A session that is the account's only runtime now takes the account rate as its estimate. The reading must meet three conditions:
If the rate moves again while nothing comes or goes, the measurement is taken back and the value before it is restored. Every other estimate is worked out as before: the measurement sits beside the estimate in
RateAttributionand never feeds into it. The other session in the example keeps its even share for as long as both run. A session that never runs alone is not changed.This is a much smaller alternative to #75 for its first case. #81 split a joint rise by hardware rates and was closed because it could be further from the real rate than
main. This change only adds a measurement, so it can be further from the real rate only if the measurement is wrong.When it can be wrong
The measurement is exact as long as the account rate follows each runtime's start and stop within two minutes. In that case every fall still to come is visible by the time the hold ends. When a runtime's rate takes longer than two minutes to leave the account, the survivor can take the rate of a runtime that is already gone. The estimate is then further from the real rate than
main, until the late fall arrives and takes the measurement back. If another runtime joins before that, the wrong value stays.Nothing in the repository says how long Colab's rate takes. #43 reports that
ccu-infokeeps the old rate for one or more polls aftercolab new.Equal to
main: if Colab's runtime count drops a reading after the account rate already fell, the rate never moves within the spell, so nothing is measured.Checks
usage.rsand 1 inmock.rs. Removing each condition (the rate having moved, the hold, the take-back, the system-time reset, the listing check) fails at least one of them.cargo test -p colab-playground-core --lib(214 tests),cargo clippy -p colab-playground-core --all-targets -- -D warningsandcargo fmt --all -- --checkpass locally on Windows.real_backend.rsand the app suite are left to CI. Nothing ran against real Colab.observe_atand throughmain'sobserve. Each trace had a start or stop about every 5 minutes, readings every 30 s or 5 s, and a reading right after each start and stop the app makes. Rows varied empty accounts against app starts with running sessions, runtimes outside the app or none, and rates that follow late on starts only or on stops too. Every session was compared at every reading:mainmainhas oneNo screenshots: the interface does not change.
Decisions
AccountUsage::record_successtakesverifiedand setsownership_verifieditself, instead of each backend overwriting it after the call.