job_report
¶
What SensAI's job agent can say about a job: which trials are running, how long they took, what failed, how it was started.
Each describe_* function works one thing out from a JobStatus and returns it as text for a model to read. They are the answers that are hard to put together by hand from the Dojo (the ranking of two hundred trials by time, the failures grouped by requirement, how long the trials running now have been at it), and none of them changes the job.
The clock is now() so a test can set it. A trial's time comes from the status files, which record when each step started and, once it ends, how long it took, so a step that is still running has a start and no length.
Outcome
module-attribute
¶
Outcome = Literal[
"any", "completed", "success", "failure", "error"
]
Which finished trials to look at: any that finished, those that completed (a success or a missed requirement, the ones the job's own times are averaged over), only the successes, only those that missed a requirement, or only those that errored.
LogLevel
module-attribute
¶
LogLevel = Literal['any', 'warning', 'error']
Which log entries to show: all of them, warnings and worse, or errors only.
RunningTrial
¶
Bases: BaseModel
A trial that has started working and has not finished.
-
Reference
mujoco_mojoutilslayersdojosensaijob_reportrunning_trials
fmt_duration
¶
A time as 9.50s, and a minute or more also as minutes and hours, as 75.30s (1m 15s).
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
trial_numbers
¶
Trial numbers as 0-9, 11, 14-15, cut after limit of them with how many more there are.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
trial_log
¶
The entries of a trial's log, or None if it has no log file or the file cannot be read.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
error_line
¶
What a trial's log says went wrong: the last line of its last traceback (ValueError: ...), else the first line of its last error entry, else None.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
running_trials
¶
running_trials(
job: JobStatus, at: datetime
) -> list[RunningTrial]
The trials running at at, the longest running first. One that is only waiting for a worker (claimed, nothing started) is not running.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
describe_summary
¶
The job's progress and timing in a few lines.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
describe_breakdown
¶
The trial numbers in each state, as ranges.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
describe_running
¶
Which trials are running, what step each is in and for how long.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
describe_ranking
¶
describe_ranking(
job: JobStatus,
count: int,
longest: bool,
outcome: Outcome = "completed",
) -> str
The trials that took the longest, or the shortest, each with its time and how it ended.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
describe_duration_statistics
¶
How long the completed trials took, as a spread, by ending, by step, and how fast they are finishing.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
describe_errored
¶
The trials that errored, grouped by what each trial's log says went wrong, with the step each was in when it broke.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
trials_that_missed
¶
The numbers of the trials that missed requirement, in order, or the sentence that says why there are none to give.
requirement is a requirement's name or part of it. The special words any (every trial that missed one or more requirements) and error (the trials that crashed, which are not the same set: an errored trial never reached its requirements) are read as words only when no requirement has exactly that name, and before a part of a name is tried, so a requirement called landing_position_error cannot swallow error.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
describe_requirements
¶
How each requirement did across the trials; for one named requirement, which trials missed it and the reasons given.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
describe_configuration
¶
How the job was started: what it runs, with which arguments, seed and processes.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
describe_trial
¶
One trial: how it ended, the time of each step, and each requirement's result.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
describe_recent
¶
describe_recent(
job: JobStatus,
at: datetime,
count: int = 5,
outcome: Outcome = "any",
) -> str
The trials that finished most recently, newest first, each with when it finished, how long it took, and for a failure the requirements it missed or for an error what its log says.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
describe_timeline
¶
When trials finished: the job's life so far cut into equal slices, each with how many finished, how they ended and their mean time, so a slowdown, a stall or the point errors began shows.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
describe_trial_log
¶
describe_trial_log(
job: JobStatus,
trial_num: int,
count: int = 20,
level: LogLevel = "any",
) -> str
The end of one trial's log, oldest of those shown first: each entry's time, level and message, tracebacks cut to their first and last lines.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
describe_comparison
¶
Trials side by side: how each ended, its time in each step, which requirements differ between them, and for an errored one what its log says.
Source code in src/mujoco_mojo/utils/layers/dojo/sensai/job_report.py
| Python | |
|---|---|
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 | |