Repository navigation
Stop routing OVRTX renderer logs through stdout for tests - #7035
mataylor-nvidia merged 4 commits into
Conversation
The kitless rendering tests overrode OVRTXRendererCfg.log_file_path to /dev/stdout (CON on Windows) so the RTX shader-compilation timeline would be visible while a test appeared to hang. OVRTX opens that path natively and, running with keep_system_alive=True, retains the handle for the lifetime of the process. Under pytest's file-descriptor capture, fd 1 is a temporary file that pytest rewinds and truncates between tests, so the retained handle keeps writing at a stale offset and the resulting sparse gap is read back as a block of NUL bytes. Drop the override entirely. log_file_path already defaults to a file under the system temp directory, so the walk over camera cfgs only ever moved the log somewhere less safe, and its hardcoded camera-name list silently missed any camera named otherwise. An autouse fixture replays the bytes each test appends, keeping the log visible per test and in failure reports without a test-owned file descriptor competing with pytest for stdout.
Greptile SummaryThe PR stops routing native OVRTX renderer output through pytest’s captured stdout and instead replays per-test additions from the renderer’s default temporary log.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "Detect OVRTX log rewrites by content, no..." | Re-trigger Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
The change removes the private stdout-redirection helper and all six call sites, allowing OVRTX to retain its default temporary log file while an autouse fixture replays bytes appended during each test.
- Design and architecture: Moving log replay into the suite-level fixture avoids mutating individual camera configurations and eliminates the incomplete hardcoded camera-name discovery. Duplicating the default log path avoids importing isaaclab_ov throughout the suite, with the non-blocking maintenance tradeoff that the fixture must be updated if that default changes.
- API: No public or extension-facing API changes were identified. OVRTXRendererCfg.log_file_path retains its existing default, and the removed helper was private with all in-patch consumers removed. The package also includes an appropriate .skip changelog fragment.
- Implementation: The fixture snapshots the current file size, handles log shrinkage by replaying from the beginning, tolerates a missing or inaccessible log, and prints only newly read content during teardown. The diagnostic replay remains heuristic if the log is replaced or truncated and regrown beyond the prior offset during one test, but this does not affect renderer behavior or restore the stdout file-descriptor conflict.
No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.
Automated review; human maintainers own approval decisions.
The replay fixture reset its offset only when the log had shrunk. A log left behind by an earlier pytest process that OVRTX then truncates and rewrites past that size stays as large or larger, so the offset survived and the replay skipped the beginning of the current test's diagnostics. Compare the 64 bytes preceding the offset instead: they only stay equal while the log was appended to. Read the replayed range as bytes so the offset keeps a single, unambiguous meaning.
|
@greptile review |
AntoineRichard
left a comment
There was a problem hiding this comment.
The root-cause analysis looks credible, but the replacement still has important diagnostic gaps and no regression coverage. Requesting changes for the following:
-
Renderer diagnostics are unavailable on hangs and native crashes (
source/isaaclab_tasks/test/conftest.py:57-75). The log is replayed only after the fixture resumes fromyield. That code cannot run after a segfault, abort, OOM, or when the outer CI supervisor kills a hung process withSIGKILL. These are precisely the failures where the native renderer log is most useful. Please have the outer supervisor include a bounded tail ofovrtx_renderer.login its crash/timeout diagnostics, or otherwise collect it outside the process being diagnosed. -
There is no regression test for the capture bug this PR fixes. Existing rendering jobs completing successfully establish neither that retained native writes no longer introduce NUL bytes nor that renderer output is preserved on failure. The repository guidelines require a regression test to fail without the fix. Please add behavioral coverage that reproduces the retained-fd/capture interaction and asserts that the resulting output contains no NUL block while the expected renderer diagnostics remain available. Coverage for truncation/rewrite and abnormal termination would also pin the new failure paths.
-
The 64-byte fingerprint can still mistake a rewrite for an append (
source/isaaclab_tasks/test/conftest.py:42-54). OVRTX startup output is substantially deterministic. If another process truncates the shared file and rewrites the same bytes around the previous offset before appending new output, the fingerprint is unchanged, so the fixture seeks to the stale offset and omits the beginning of the current log. A process-unique log path or explicit ownership/session cleanup would avoid inferring file generation from content. -
Failure replay is unbounded (
source/isaaclab_tasks/test/conftest.py:72-75).handle.read()prints the entire appended verbose renderer log into pytest capture and potentially JUnit output. A long failing rendering test can therefore recreate the oversized-log problem with real text rather than sparse NUL bytes. Please cap the replay to a documented tail size and state when earlier bytes were omitted.
I verified these findings against head commit e7155265df5350ccda8644fd92e87e7ee8190e1d. The passing kitless-rendering CI job contains no NUL bytes, but it also contains no OVRTX renderer log: replay section because no failure exercised that path.
|
Added fixes for the 4 comments AntoineRichard posted |
| """ | ||
| section = ovrtx_log.format_log_section(ovrtx_log.LOG_PATH, label) | ||
| if section: | ||
| logger.info(section) |
There was a problem hiding this comment.
It seems you redirect all ovrtx logging into info, should we redirect ovrtx logged messages to appropriate loggers?
There was a problem hiding this comment.
I removed this
|
I created another PR ontop of this one and broke the test on purpose to see we are indeed still receiving ovrtx logs: |
Description
Fixes large blocks of NUL bytes being written to CI logs during kitless rendering tests, at the source.
The kitless rendering tests overrode
OVRTXRendererCfg.log_file_pathto/dev/stdout(CONon Windows), added in #5749 so the RTX shader-compilation timeline would be visible while a test appeared to hang.OVRTX opens that path natively and, running with
keep_system_alive=True, retains the handle for the lifetime of the process. Under pytest's file-descriptor capture, fd 1 is a temporary file that pytest rewinds and truncates between tests, so the retained handle keeps writing at a stale offset and the resulting sparse gap is read back as a block of NUL bytes.This drops the override entirely rather than working around it.
log_file_pathalready defaults to<system temp>/ovrtx_renderer.log, so_redirect_ovrtx_renderer_log_to_stdout()only ever moved the log somewhere less safe — and its hardcoded camera-name list (tiled_camera,base_camera,wrist_camera) silently missed any camera named otherwise.To keep the log visible, an autouse fixture in
source/isaaclab_tasks/test/conftest.pyreplays the bytes each test appends. It is a no-op for tests that never build an OVRTX renderer, records only the byte range written during the test, and replays from the beginning when the 64 bytes in front of that range changed — the log was truncated and rewritten, by OVRTX opening one an earlier pytest process left behind, say.Net effect: 48 lines deleted, 36 added, and no test-owned file descriptor competing with pytest for stdout.
Alternative considered
Running the child pytest with
--capture=sys(#7031) avoids the sparse-file mechanism, but breaksSimulationApp.__init__, which callsfaulthandler.enable()— that needs a real fd, and undersyscapturesys.stderris aCaptureIOwith nofileno(). It also sends every native fd-1/fd-2 write and all subprocess output from passing tests straight to the job log, reversing #6462.Type of change
Screenshots
Failure output with the fixture in place:
Checklist
pre-commitchecks with./isaaclab.sh --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bumpextension.toml— CI handles that)CONTRIBUTORS.mdor my name already exists there