Skip to content

Update ROCProfiler-SDK Runners - #10

Merged
ammarwa merged 1 commit into
amd/hsivasun/modify-workflowsfrom
amd/aelwazir/sdk_runners_update
Jul 28, 2025
Merged

ammarwa merged 1 commit into
amd/hsivasun/modify-workflowsfrom
amd/aelwazir/sdk_runners_update

Conversation

@ammarwa

@ammarwa ammarwa commented Jul 28, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@ammarwa
ammarwa merged commit 53a95f7 into amd/hsivasun/modify-workflows Jul 28, 2025
@ammarwa
ammarwa deleted the amd/aelwazir/sdk_runners_update branch July 28, 2025 19:41
systems-assistant Bot pushed a commit that referenced this pull request Aug 5, 2025
Adding Public Sync to ROCProfiler

Co-authored-by: Ammar ELWazir <aelwazir@amd.com>
systems-assistant Bot pushed a commit that referenced this pull request Aug 5, 2025
* Obey CMAKE_BUILD_TYPE

Obey CMAKE_BUILD_TYPE when it is passed on the command line. Previous
behavior remains:

Debug by default
ROCRTST_BLD_TYPE can set build type

* External CI: change trigger from amd-master to amd-mainline

* Added gfx94x and gfx11xx  IDs to enumerator (#5)

* Use idomatic approach to extending CMAKE_MODULE_PATH. (#7)

There are many reasons why there may already be a CMAKE_MODULE_PATH defined.
The idiomatic way to extend it in a project is via list(APPEND).

ROCm/rocminfo#97 submitted by @stellaraccident

Co-authored-by: Stella Laurenzo <Stella.Laurenzo@amd.com>

* Added release trigger for further releases

* Fix for typo in ISA_TO_ID table (#6)

Change-Id: Id0720988fb01079a3ca6f3287dc743d93db4fd0f

* Remove WSL checks for displaying UUID and BDFID

Signed-off-by: lyndonli <Lyndon.Li@amd.com>

* Added KWS check for amd-mainline (#9)

---------

Signed-off-by: lyndonli <Lyndon.Li@amd.com>
Co-authored-by: benrichard-amd <ben.richard@amd.com>
Co-authored-by: Su, Daniel <Daniel.Su@amd.com>
Co-authored-by: Stella Laurenzo <Stella.Laurenzo@amd.com>
Co-authored-by: Mallya, Ameya Keshava <AmeyaKeshava.Mallya@amd.com>
Co-authored-by: Yat Sin, David <David.YatSin@amd.com>
Co-authored-by: lyndonli <Lyndon.Li@amd.com>
systems-assistant Bot pushed a commit that referenced this pull request Aug 5, 2025
Revert "Revert "SWDEV-521313 - Streamline Version Management: Retain Only version-roc…""

This reverts commit 39bd62e.
systems-assistant Bot pushed a commit that referenced this pull request Aug 5, 2025
* Added install target for simple-hip executable

* Updating destination path

* Update CMakeLists.txt

* Update CMakeLists.txt

* Test Installed Packages

* Updating Destination path

* Update continuous-integration.yml

* Update continuous-integration.yml

* Adding env

* Adding PACKAGING_INSTALL_PREFIX

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Add libasan.so path for AddressSanitizer preloadiing

* Add libasan.so path for AddressSanitizer preloadiing

* Add libasan.so path for test test-simple-hip-normal

* Added sanitizer runtime library for tests

* Added LD_PRELOAD to simple-hip-normal-env test

* Added LD_PRELOAD to simple-hip-normal-env test

* Update CMakeLists.txt

* Update CMakeLists.txt

* Update CMakeLists.txt

* Formatting

* Updated path for simple-hip-preload-env

* Updated path for simple-hip-preload-env

* Update continuous-integration.yml

* Updated preload path for  simple-hip-preload-env

* Updated preload path for  simple-hip-preload-env

---------

Co-authored-by: Sushma Vaddireddy <svaddire@amd.com>
Co-authored-by: Elwazir, Ammar <Ammar.Elwazir@amd.com>
jayhawk-commits pushed a commit that referenced this pull request Aug 5, 2025
* Added install target for simple-hip executable

* Updating destination path

* Update CMakeLists.txt

* Update CMakeLists.txt

* Test Installed Packages

* Updating Destination path

* Update continuous-integration.yml

* Update continuous-integration.yml

* Adding env

* Adding PACKAGING_INSTALL_PREFIX

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Update continuous-integration.yml

* Add libasan.so path for AddressSanitizer preloadiing

* Add libasan.so path for AddressSanitizer preloadiing

* Add libasan.so path for test test-simple-hip-normal

* Added sanitizer runtime library for tests

* Added LD_PRELOAD to simple-hip-normal-env test

* Added LD_PRELOAD to simple-hip-normal-env test

* Update CMakeLists.txt

* Update CMakeLists.txt

* Update CMakeLists.txt

* Formatting

* Updated path for simple-hip-preload-env

* Updated path for simple-hip-preload-env

* Update continuous-integration.yml

* Updated preload path for  simple-hip-preload-env

* Updated preload path for  simple-hip-preload-env

---------

Co-authored-by: Sushma Vaddireddy <svaddire@amd.com>
Co-authored-by: Elwazir, Ammar <Ammar.Elwazir@amd.com>

[ROCm/rocprofiler-register commit: 03d5821]
jayhawk-commits pushed a commit that referenced this pull request Aug 5, 2025
Adding Public Sync to ROCProfiler

Co-authored-by: Ammar ELWazir <aelwazir@amd.com>

[ROCm/rocprofiler commit: 5891f34]
jayhawk-commits pushed a commit that referenced this pull request Aug 5, 2025
ammallya pushed a commit that referenced this pull request Aug 6, 2025
Updated OS test matrix to match ROCm 6.2. 
Update build and CI docker files
Remove the "docs" workflow, because "read-the-docs" is now being used for ROCm documentation

[ROCm/rocprofiler-systems commit: b15c9e9]
ammallya pushed a commit that referenced this pull request Aug 7, 2025
* reducing docs logging

* Addressing review comments

* exclude dirs

* maximize NUM_PROC_THREADS

* parallel build

[ROCm/rocprofiler-sdk commit: 3ee06ed]
jayhawk-commits pushed a commit that referenced this pull request Aug 11, 2025
* Obey CMAKE_BUILD_TYPE

Obey CMAKE_BUILD_TYPE when it is passed on the command line. Previous
behavior remains:

Debug by default
ROCRTST_BLD_TYPE can set build type

* External CI: change trigger from amd-master to amd-mainline

* Added gfx94x and gfx11xx  IDs to enumerator (#5)

* Use idomatic approach to extending CMAKE_MODULE_PATH. (#7)

There are many reasons why there may already be a CMAKE_MODULE_PATH defined.
The idiomatic way to extend it in a project is via list(APPEND).

ROCm/rocminfo#97 submitted by @stellaraccident

Co-authored-by: Stella Laurenzo <Stella.Laurenzo@amd.com>

* Added release trigger for further releases

* Fix for typo in ISA_TO_ID table (#6)

Change-Id: Id0720988fb01079a3ca6f3287dc743d93db4fd0f

* Remove WSL checks for displaying UUID and BDFID

Signed-off-by: lyndonli <Lyndon.Li@amd.com>

* Added KWS check for amd-mainline (#9)

---------

Signed-off-by: lyndonli <Lyndon.Li@amd.com>
Co-authored-by: benrichard-amd <ben.richard@amd.com>
Co-authored-by: Su, Daniel <Daniel.Su@amd.com>
Co-authored-by: Stella Laurenzo <Stella.Laurenzo@amd.com>
Co-authored-by: Mallya, Ameya Keshava <AmeyaKeshava.Mallya@amd.com>
Co-authored-by: Yat Sin, David <David.YatSin@amd.com>
Co-authored-by: lyndonli <Lyndon.Li@amd.com>

[ROCm/rocminfo commit: aec5d6f]
jayhawk-commits pushed a commit that referenced this pull request Aug 11, 2025
Revert "Revert "SWDEV-521313 - Streamline Version Management: Retain Only version-roc…""

This reverts commit c48c9da.

[ROCm/rocm-core commit: de37842]
ammallya pushed a commit that referenced this pull request Jan 21, 2026
ammallya pushed a commit that referenced this pull request Jan 21, 2026
topic/ipc context

[ROCm/rocshmem commit: d21d5aa]
powderluv added a commit that referenced this pull request Feb 21, 2026
Addresses code review issue #10: Missing bounds checking on array copies.

Changes:
- Added validation in hipGraphGetEdges to ensure server response doesn't
  exceed allocated buffer size before copying edge pairs
- Calculate max_safe_edges based on actual response buffer size
- Prevents potential buffer overflow if malicious/buggy worker sends
  corrupted num_edges value larger than buffer contains

Security improvement: Protects against reading past allocated memory
even if server sends invalid response.

Co-Authored-By: Claude (Claude-Sonnet-4.5) <noreply@anthropic.com>
powderluv pushed a commit that referenced this pull request Feb 22, 2026
Addresses code review issue #10: Missing bounds checking on array copies.

Changes:
- Added validation in hipGraphGetEdges to ensure server response doesn't
  exceed allocated buffer size before copying edge pairs
- Calculate max_safe_edges based on actual response buffer size
- Prevents potential buffer overflow if malicious/buggy worker sends
  corrupted num_edges value larger than buffer contains

Security improvement: Protects against reading past allocated memory
even if server sends invalid response.

Co-Authored-By: Claude (Claude-Sonnet-4.5) <noreply@anthropic.com>
powderluv pushed a commit that referenced this pull request Feb 23, 2026
Addresses code review issue #10: Missing bounds checking on array copies.

Changes:
- Added validation in hipGraphGetEdges to ensure server response doesn't
  exceed allocated buffer size before copying edge pairs
- Calculate max_safe_edges based on actual response buffer size
- Prevents potential buffer overflow if malicious/buggy worker sends
  corrupted num_edges value larger than buffer contains

Security improvement: Protects against reading past allocated memory
even if server sends invalid response.

Co-Authored-By: Claude (Claude-Sonnet-4.5) <noreply@anthropic.com>
stellaraccident added a commit that referenced this pull request Feb 26, 2026
## Summary
- `parse_fatbin_data()` only decompressed the first CCOB entry in a
multi-CCOB `.hip_fatbin` section
- Multi-TU HIP binaries produce one CCOB per kernel — a binary with 32
kernels had all 32 silently discarded except the first
- The kpack archive contained only `#0` ordinals; at runtime CLR
requests `co_index` 1..N which all fail with "kernel not found"
- Fix: loop through all CCOB entries using `CCOBHeader.total_size` to
advance, following LLVM's `extractOffloadBundle()` approach
(`llvm/lib/Object/OffloadBundle.cpp:33-99`)

## Evidence
CI run
[22213248041](https://github.com/ROCm/TheRock/actions/runs/22213248041)
— 11/29 gfx942 test suites failed. Static analysis of
`test_hipcub_device_segmented_radix_sort`:
- Unsplit binary: 32 CCOB entries in `.hip_fatbin` (5.98 MB), all
`gfx942`
- Split archive: 435 entries, all at ordinal `#0` — ordinals `#1`..`#31`
missing
- CI log: `co_index=0` succeeds, `co_index=4` fails with "kernel not
found in this archive"

After fix: `extract_code_objects_from_fatbin()` returns 32 code objects
(was 1).

## Test plan
- [x] 4 new unit tests: single CCOB, multiple CCOBs, page-aligned
padding, empty data
- [x] Verified on real CI artifact (32 code objects extracted)
- [x] Full test suite: 394 passed, 2 skipped

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
stellaraccident added a commit that referenced this pull request Feb 26, 2026
## Summary
- When `kpack_get_kernel()` fails with `KPACK_ERROR_KERNEL_NOT_FOUND`
after finding a matching archive+arch, the loader now returns
immediately instead of falling through to probe the next ISA (e.g.,
`gfx9-4-generic`)
- The previous behavior produced misleading "no matching architecture
found" errors and wasted time probing archives that can't help

## Evidence
CI log for rocblas showed:
```
kpack: opened and cached archive: .../blas_lib_gfx942.kpack
kpack:   architecture: gfx942
kpack:   kernel not found in this archive          <-- should stop here
kpack: trying architecture: gfx9-4-generic         <-- wrong: kept probing
kpack: no matching architecture found in any archive
```

The kernel (`#45`) wasn't in the archive due to the multi-CCOB bug (PR
#10). But regardless, once we match an archive and architecture, the
result is definitive.

## Test plan
- [x] New test `LoadCodeObject_KernelNotFound`: archive found, arch
matches, but `co_index=999` not in TOC → `KPACK_ERROR_KERNEL_NOT_FOUND`
- [x] 101/101 CTest pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
jeffqjiangNew added a commit that referenced this pull request Mar 13, 2026
## Motivation

This PR adds entry and exit logs for core functions.

## Technical Details

- Info level (3) logs are added at core function entry and exit points.
- Monotonic clock stamp, process id, thread id, and file name are added
to the logs.
- The logs now have similar format to HIP logs for better viewing when
both are present.
- Direct error or warning logs to std::cerr. Other logs still go to
std::cout.

## JIRA ID

<!-- If applicable, mention the JIRA ID resolved by this PR (Example:
Resolves SWDEV-12345). -->
<!-- Do not post any JIRA links here. -->

## Test Plan

Set env variable ROCDEC_LOG_LEVEL to control log output.

All CTests and conformance tests must pass. Example summary of the test
results:
- CTests:

      Start  1: video_decodeRaw-HEVC
 1/15 Test  #1: video_decodeRaw-HEVC .............   Passed    2.05 sec
      Start  2: video_decodeRaw-AVC
 2/15 Test  #2: video_decodeRaw-AVC ..............   Passed    1.89 sec
      Start  3: video_decodeRaw-AV1
 3/15 Test  #3: video_decodeRaw-AV1 ..............   Passed    2.31 sec
      Start  4: video_decodeRaw-VP9
 4/15 Test  #4: video_decodeRaw-VP9 ..............   Passed    2.04 sec
      Start  5: rocdec_Decode-HEVC
 5/15 Test  #5: rocdec_Decode-HEVC ...............   Passed    0.92 sec
      Start  6: rocDecode_Negative_API_Tests
 6/15 Test  #6: rocDecode_Negative_API_Tests .....   Passed    0.78 sec
      Start  7: video_decode-HEVC
 7/15 Test  #7: video_decode-HEVC ................   Passed    2.74 sec
      Start  8: video_decode-AVC
 8/15 Test  #8: video_decode-AVC .................   Passed    2.64 sec
      Start  9: video_decode-AV1
 9/15 Test  #9: video_decode-AV1 .................   Passed    2.74 sec
      Start 10: video_decode-VP9
10/15 Test #10: video_decode-VP9 .................   Passed    2.78 sec
      Start 11: video_decodePerf-HEVC
11/15 Test #11: video_decodePerf-HEVC ............   Passed    2.92 sec
      Start 12: video_decodeBatch
12/15 Test #12: video_decodeBatch ................   Passed    4.34 sec
      Start 13: video_decodeRGB-HEVC
13/15 Test #13: video_decodeRGB-HEVC .............   Passed   33.51 sec
      Start 14: video_decodeMem-HEVC
14/15 Test #14: video_decodeMem-HEVC .............   Passed    2.09 sec
      Start 15: video_decodeRGB-Resize
15/15 Test #15: video_decodeRGB-Resize ...........   Passed   33.94 sec

100% tests passed, 0 tests failed out of 15

- AVC conformance test:
Conformance test completed on the 127 streams:
     - The number of passing streams is 127
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

- HEVC conformance test:
Conformance test completed on the 135 streams:
     - The number of passing streams is 135
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

- AV1 conformance test:
Conformance test completed on the 162 streams:
     - The number of passing streams is 162
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

- VP9 conformance test:
Conformance test completed on the 108 streams:
     - The number of passing streams is 108
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

## Test Result

Function entry/exit logs should show up when ROCDEC_LOG_LEVEL >= 3.

All conformance tests should pass.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
Nikhil-Nunna pushed a commit that referenced this pull request Mar 13, 2026
## Motivation

This PR adds entry and exit logs for core functions.

## Technical Details

- Info level (3) logs are added at core function entry and exit points.
- Monotonic clock stamp, process id, thread id, and file name are added
to the logs.
- The logs now have similar format to HIP logs for better viewing when
both are present.
- Direct error or warning logs to std::cerr. Other logs still go to
std::cout.

## JIRA ID

<!-- If applicable, mention the JIRA ID resolved by this PR (Example:
Resolves SWDEV-12345). -->
<!-- Do not post any JIRA links here. -->

## Test Plan

Set env variable ROCDEC_LOG_LEVEL to control log output.

All CTests and conformance tests must pass. Example summary of the test
results:
- CTests:

      Start  1: video_decodeRaw-HEVC
 1/15 Test  #1: video_decodeRaw-HEVC .............   Passed    2.05 sec
      Start  2: video_decodeRaw-AVC
 2/15 Test  #2: video_decodeRaw-AVC ..............   Passed    1.89 sec
      Start  3: video_decodeRaw-AV1
 3/15 Test  #3: video_decodeRaw-AV1 ..............   Passed    2.31 sec
      Start  4: video_decodeRaw-VP9
 4/15 Test  #4: video_decodeRaw-VP9 ..............   Passed    2.04 sec
      Start  5: rocdec_Decode-HEVC
 5/15 Test  #5: rocdec_Decode-HEVC ...............   Passed    0.92 sec
      Start  6: rocDecode_Negative_API_Tests
 6/15 Test  #6: rocDecode_Negative_API_Tests .....   Passed    0.78 sec
      Start  7: video_decode-HEVC
 7/15 Test  #7: video_decode-HEVC ................   Passed    2.74 sec
      Start  8: video_decode-AVC
 8/15 Test  #8: video_decode-AVC .................   Passed    2.64 sec
      Start  9: video_decode-AV1
 9/15 Test  #9: video_decode-AV1 .................   Passed    2.74 sec
      Start 10: video_decode-VP9
10/15 Test #10: video_decode-VP9 .................   Passed    2.78 sec
      Start 11: video_decodePerf-HEVC
11/15 Test #11: video_decodePerf-HEVC ............   Passed    2.92 sec
      Start 12: video_decodeBatch
12/15 Test #12: video_decodeBatch ................   Passed    4.34 sec
      Start 13: video_decodeRGB-HEVC
13/15 Test #13: video_decodeRGB-HEVC .............   Passed   33.51 sec
      Start 14: video_decodeMem-HEVC
14/15 Test #14: video_decodeMem-HEVC .............   Passed    2.09 sec
      Start 15: video_decodeRGB-Resize
15/15 Test #15: video_decodeRGB-Resize ...........   Passed   33.94 sec

100% tests passed, 0 tests failed out of 15

- AVC conformance test:
Conformance test completed on the 127 streams:
     - The number of passing streams is 127
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

- HEVC conformance test:
Conformance test completed on the 135 streams:
     - The number of passing streams is 135
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

- AV1 conformance test:
Conformance test completed on the 162 streams:
     - The number of passing streams is 162
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

- VP9 conformance test:
Conformance test completed on the 108 streams:
     - The number of passing streams is 108
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

## Test Result

Function entry/exit logs should show up when ROCDEC_LOG_LEVEL >= 3.

All conformance tests should pass.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
jeffqjiangNew added a commit that referenced this pull request Apr 2, 2026
…4229)

## Motivation

This PR adds a new rocDecode feature: support for user specified output
surface format.

## Technical Details

In certain use cases, the user requests a decoded image format that is
not the native format based on the stream content. For example, 8-bit
output is needed on a 10-bit stream. This PR enables the output format
selection as long as it is supported by the VA-API driver.
- Added a special output format define to indicate if the output format
is user set or native.
- VA-API decoder now sets the surface format either native or by user
override.
- Added the output format command option to rocdecdecode sample for
feature verification.
## JIRA ID

<!-- If applicable, mention the JIRA ID resolved by this PR (Example:
Resolves SWDEV-12345). -->
<!-- Do not post any JIRA links here. -->

## Test Plan

- Run CTests and decode conformance tests to catch any regressions. 
- Run rocdecdecode samples to verify user set output.
## Test Result

All CTests and conformance tests pass. Example summary of the test
results:

CTests:
      Start  1: video_decodeRaw-HEVC
1/15 Test #1:
video_decodeRaw-HEVC ............. Passed 2.05 sec
      Start  2: video_decodeRaw-AVC
2/15 Test #2:
video_decodeRaw-AVC .............. Passed 1.89 sec
      Start  3: video_decodeRaw-AV1
3/15 Test #3:
video_decodeRaw-AV1 .............. Passed 2.31 sec
      Start  4: video_decodeRaw-VP9
4/15 Test #4:
video_decodeRaw-VP9 .............. Passed 2.04 sec
      Start  5: rocdec_Decode-HEVC
5/15 Test #5:
rocdec_Decode-HEVC ............... Passed 0.92 sec
      Start  6: rocDecode_Negative_API_Tests
6/15 Test #6:
rocDecode_Negative_API_Tests ..... Passed 0.78 sec
      Start  7: video_decode-HEVC
7/15 Test #7: video_decode-HEVC
................ Passed 2.74 sec
      Start  8: video_decode-AVC
8/15 Test #8: video_decode-AVC
................. Passed 2.64 sec
      Start  9: video_decode-AV1
9/15 Test #9: video_decode-AV1
................. Passed 2.74 sec
      Start 10: video_decode-VP9
10/15 Test #10:
video_decode-VP9 ................. Passed 2.78 sec
      Start 11: video_decodePerf-HEVC
11/15 Test #11:
video_decodePerf-HEVC ............ Passed 2.92 sec
      Start 12: video_decodeBatch
12/15 Test #12:
video_decodeBatch ................ Passed 4.34 sec
      Start 13: video_decodeRGB-HEVC
13/15 Test #13:
video_decodeRGB-HEVC ............. Passed 33.51 sec
      Start 14: video_decodeMem-HEVC
14/15 Test #14:
video_decodeMem-HEVC ............. Passed 2.09 sec
      Start 15: video_decodeRGB-Resize
15/15 Test #15:
video_decodeRGB-Resize ........... Passed 33.94 sec

100% tests passed, 0 tests failed out of 15

AVC conformance test:
Conformance test completed on the 127 streams:

The number of passing streams is 127
The number of failing streams is 0
The number of streams that did not finish decoding is 0
HEVC conformance test:
Conformance test completed on the 135 streams:

The number of passing streams is 135
The number of failing streams is 0
The number of streams that did not finish decoding is 0
AV1 conformance test:
Conformance test completed on the 162 streams:

The number of passing streams is 162
The number of failing streams is 0
The number of streams that did not finish decoding is 0
VP9 conformance test:
Conformance test completed on the 108 streams:

The number of passing streams is 108
The number of failing streams is 0
The number of streams that did not finish decoding is 0
<!-- Briefly summarize test outcomes. -->

rocdecdecode sample dumps the clean output YUV clips of the specified
format (NV12 or P016).

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
gandryey pushed a commit that referenced this pull request Apr 6, 2026
…4229)

## Motivation

This PR adds a new rocDecode feature: support for user specified output
surface format.

## Technical Details

In certain use cases, the user requests a decoded image format that is
not the native format based on the stream content. For example, 8-bit
output is needed on a 10-bit stream. This PR enables the output format
selection as long as it is supported by the VA-API driver.
- Added a special output format define to indicate if the output format
is user set or native.
- VA-API decoder now sets the surface format either native or by user
override.
- Added the output format command option to rocdecdecode sample for
feature verification.
## JIRA ID

<!-- If applicable, mention the JIRA ID resolved by this PR (Example:
Resolves SWDEV-12345). -->
<!-- Do not post any JIRA links here. -->

## Test Plan

- Run CTests and decode conformance tests to catch any regressions. 
- Run rocdecdecode samples to verify user set output.
## Test Result

All CTests and conformance tests pass. Example summary of the test
results:

CTests:
      Start  1: video_decodeRaw-HEVC
1/15 Test #1:
video_decodeRaw-HEVC ............. Passed 2.05 sec
      Start  2: video_decodeRaw-AVC
2/15 Test #2:
video_decodeRaw-AVC .............. Passed 1.89 sec
      Start  3: video_decodeRaw-AV1
3/15 Test #3:
video_decodeRaw-AV1 .............. Passed 2.31 sec
      Start  4: video_decodeRaw-VP9
4/15 Test #4:
video_decodeRaw-VP9 .............. Passed 2.04 sec
      Start  5: rocdec_Decode-HEVC
5/15 Test #5:
rocdec_Decode-HEVC ............... Passed 0.92 sec
      Start  6: rocDecode_Negative_API_Tests
6/15 Test #6:
rocDecode_Negative_API_Tests ..... Passed 0.78 sec
      Start  7: video_decode-HEVC
7/15 Test #7: video_decode-HEVC
................ Passed 2.74 sec
      Start  8: video_decode-AVC
8/15 Test #8: video_decode-AVC
................. Passed 2.64 sec
      Start  9: video_decode-AV1
9/15 Test #9: video_decode-AV1
................. Passed 2.74 sec
      Start 10: video_decode-VP9
10/15 Test #10:
video_decode-VP9 ................. Passed 2.78 sec
      Start 11: video_decodePerf-HEVC
11/15 Test #11:
video_decodePerf-HEVC ............ Passed 2.92 sec
      Start 12: video_decodeBatch
12/15 Test #12:
video_decodeBatch ................ Passed 4.34 sec
      Start 13: video_decodeRGB-HEVC
13/15 Test #13:
video_decodeRGB-HEVC ............. Passed 33.51 sec
      Start 14: video_decodeMem-HEVC
14/15 Test #14:
video_decodeMem-HEVC ............. Passed 2.09 sec
      Start 15: video_decodeRGB-Resize
15/15 Test #15:
video_decodeRGB-Resize ........... Passed 33.94 sec

100% tests passed, 0 tests failed out of 15

AVC conformance test:
Conformance test completed on the 127 streams:

The number of passing streams is 127
The number of failing streams is 0
The number of streams that did not finish decoding is 0
HEVC conformance test:
Conformance test completed on the 135 streams:

The number of passing streams is 135
The number of failing streams is 0
The number of streams that did not finish decoding is 0
AV1 conformance test:
Conformance test completed on the 162 streams:

The number of passing streams is 162
The number of failing streams is 0
The number of streams that did not finish decoding is 0
VP9 conformance test:
Conformance test completed on the 108 streams:

The number of passing streams is 108
The number of failing streams is 0
The number of streams that did not finish decoding is 0
<!-- Briefly summarize test outcomes. -->

rocdecdecode sample dumps the clean output YUV clips of the specified
format (NV12 or P016).

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
ammallya pushed a commit that referenced this pull request Apr 9, 2026
ammallya pushed a commit that referenced this pull request Apr 9, 2026
ammarwa added a commit that referenced this pull request Apr 19, 2026
…ale READ_ONLY docstring

Finding #10: _default_store() now emits logging.INFO with the fully resolved task store path on first initialization (including reminder to set PERFXPERT_TASK_ROOT). perfxpert doctor _check_task_store() warns in its message string when PERFXPERT_TASK_ROOT is unset so the warning surfaces via 'perfxpert doctor'.

Finding #18: Module docstring changed from "Tool class: READ_ONLY" (inaccurate) to "Tool class: side-effecting on the local .perfxpert/ task store. Does NOT modify user source or GPU traces."

Tests: test_default_store_logs_path_on_first_init, test_default_store_uses_perfxpert_task_root_env.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ammarwa added a commit that referenced this pull request Apr 23, 2026
… polish + contributing docs (#5174)

## Summary

Proven-optimizations catalog, nightly benchmark harness, contributing
guides + RFC process + architecture refresh, `perfxpert doctor` polish,
Phase 7.1 `ai_analysis/` module deletion, and the convergence-review
fixes that establish real legacy-vs-agentic parity. This is the last PR
in the original retirement series; subsequent PRs (#5179, #5180) add the
bundled opencode fork and the docs-audit toolchain.

Stacks on #5173. Next in stack: #5179.

## What lands

### Phase 7.1 — `perfxpert/ai_analysis/` module removed
Commit `cb03e82c36` deletes the entire `ai_analysis/` module — **21
files, ~11.7 KLOC**. All execution now routes through
`perfxpert/agents/`; the dispatcher and the `PERFXPERT_LEGACY` env
toggle are gone. This completes the retirement started in #5173: there
is no longer a "legacy path" to opt back into.

### Proven-optimizations catalog (10 canonical case studies)
- `knowledge/proven_optimizations.yaml`: vgpr_reduction, lds_tiling,
mfma_enablement, memory_coalescing, fast_math, hip_stream_overlap,
kernel_fusion, device_sync_removal, warp_primitives, cache_blocking
- Dual-schema fixture integration: synthetic `duration_ns` + real
rocprofv3 UUID-suffixed `(end_ns - start_ns)` tables
- `tests/fixtures/*.db`: 5 fixtures re-profiled with `--pmc` on real
MI300X hardware

### Nightly benchmark harness + orchestration

### Contributing guides + RFC process + architecture refresh

### `perfxpert doctor` polish (8 checks incl. opencode bundled + LLM
providers)

## Review findings addressed (29 findings, 5 fix batches)

### Batch 1 — Gate cascade fidelity (3 commits)
- `gate-2-sol-signature`: `_run_sol_gate` took wrong keyword; unit tests
mocked the function so the TypeError went undetected. Two-tier check
now: hard cap on speedup ratio (>50× rejected arch-independent) +
optional absolute FLOPS check via `sol.sanity_check`. 13 new un-mocked
integration tests (`TestRunSolGateUnmocked`).
- `gate-4-hot-kernel-key-unit`: `regression.compare_runs` returns
`per_kernel_deltas` (list of dicts with `delta_pct` as a **fraction**,
not percent), not `hot_kernels`. Old code iterated a non-existent key so
Gate 4 silently treated all regressions as OK. Fraction↔percent
conversion corrected.
- `gate-5-skip-verdict`: verdict strings no longer misleading on skip
(`candidate_binary=None` path).

### Batch 2 — Schemas, validators, framework invariants (6 findings)
- #4: Pydantic cross-field validators on `GateVerdictModel`
(status/failing_gate coupling), `CorrectnessOutput` (verdict/action),
confidence clamps `Field(..., ge=0.0, le=1.0)`, typed `Literal` for
provider
- #12: `Agent` dataclass `frozen=True`; `__post_init__` validates layer
in (0,1,2)
- #7: `_parse_headers` raises `ValueError` on malformed JSON instead of
silent `{}`
- #10, #18: tasks module logs resolved store path; stale READ_ONLY
docstrings rewritten
- #17: README clarifies opencode is system dependency; doctor warns when
PERFXPERT_TASK_ROOT unset

### Batch 3 — External tool verifier + fence alignment (6 findings)
- N28: anthropic/openai SDK imports routed through `require_tool()` with
install-hint on missing
- N29: all 8 agent fence slices aligned to actual agent tool allowlists
- #5, #6, #9, #17: smoke-test opencode binary (not just presence),
hard-fail on bad `PERFXPERT_OPENCODE_PATH` override, skip subdirs in
config copy
- `tooldep`: user-home path search +
`PERFXPERT_ROCPROF_TRACE_DECODER_PATH` env support

### Batch 4 — Classifier + data-provenance fidelity (2 findings)
- **#1**: classifier no longer swallows DB errors silently (was
returning empty metrics → `data_insufficient`; now logs + propagates
error markers)
- **#26 (priority user-flagged)**: confidence now weighted by
`evidence_strength × match_ratio` instead of raw rule-count
normalization — partial-PMC classifications no longer over-confident.
New `test_partial_pmc_confidence` covers trace-only vs full-PMC paths.

### Batch 5 — Tests coverage gaps (9 findings)
- #20: gate cascade short-circuit coverage (Gates 2/3/4)
- #21: `_TraceAnalysisAdapter` shim delegation tests
- #22: trace-only `memcpy_pct` path in `classify_from_metrics`
- #23: `anthropic.APITimeoutError` normalization path
- #24: Root agent lambda stub guard
(`test_root.py::test_lambda_stubs_never_invoked`)
- #25: MCP tool coverage across 5 representative tools
- #27: flaky `time.sleep` → `proc.wait(timeout=5)`
- #14, #15, #16: stale comments + docstring rewrites (api.py,
__main__.py, recommendation.py)

## Parity story

**Problem found during review**: parity test wiring was toggling a dead
flag (`PERFXPERT_USE_AGENTS`) after the retirement PR flipped the
default — both legs were running the agentic path. "Parity" passed
vacuously.

**Fixes applied (Decision A+C):**
- **A**: Parity runner now toggles the operative legacy opt-out so
legacy and agentic paths are genuinely distinct; Tier-1 trace-only
fixtures `xfail`ed until re-profiled with `--pmc`.
- **C**: Re-profiled all 5 fixtures (`baseline`, `memory_bound`,
`compute_bound`, `latency_bound`, `regressed`) on real MI300X with
`rocprofv3 --pmc`:
- `compute_bound`: VALU-bound kernel (not MFMA, to legitimately match
Compute-Bound classification)
  - `memory_bound` / `baseline`: 128 MB H2D+D2H loop
  - `latency_bound` / `regressed`: 6,000 tiny kernels
- `_build_analysis_result` returns `api_overhead` (not `latency`) for
`overhead_pct > 25%` (legacy heuristic fix)
- E2E + dashboard tests updated for evidence-weighted classification

**Result**: `parity_snapshots/_aggregate.json` → **100% agreement on PMC
fixtures** (10/10 bottleneck + rec_technique signals). `rec_type` signal
skipped where the agentic path can't populate without an LLM (documented
asymmetric None).

## Convergence review round (2026-04-18)

- **Brand scrub**: zero-tolerance removal of the prior codename across
code, tests, patches, env-var names, and documentation.
- **CLI flag plumbing**: all 10 CLI flags (`--prompt`, `--llm`,
`--llm-model`, `--att-dir`, `--pc-sampling`, `--source-dir`, `--format`,
`-d/-o`) now wired end-to-end via an `analysis_options` side-channel on
`Context`.
- **PMC shard UNION** across multiple `.db` files uses
column-intersection and emits a `RuntimeWarning` listing dropped
columns.
- **FallbackProvider** has a typed exception taxonomy
(`LLMRateLimitError`, `LLMAuthenticationError`, `LLMTransientError`,
`LLMFatalError`). Auth/fatal errors surface immediately; only transient
+ rate-limit cascade. The provider is wired into `build_session`;
`PERFXPERT_LLM_FALLBACK_CHAIN` now has runtime effect.

## Test plan

- [x] 1036 pass / 3 skip / 0 fail from `experimental/python/perfxpert/`
- [x] Core suites — 100% pass: `tests/test_agents + test_providers +
test_runtime + test_tools`
- [x] Parity ship-gate — 100%: `tests/test_parity/` (12 passed, 5
rec_type skips documented)
- [x] Gate cascade — 100%: 28 tests including 13 new un-mocked SOL
integration tests (Batch 1 recovery)
- [x] E2E brain: `perfxpert-code run -m openai/gpt-4o-mini "..."` → MCP
→ Python → `81.7 TFLOPS` + AMD footer
- [x] `perfxpert doctor`: all 8 checks green (34 MCP tools at this PR
boundary; 43 after #5179+#5180; opencode 1.4.11 bundled; 3/5 LLM
providers configured)
- [x] No legacy opt-out path remains (Phase 7.1 removed the dispatcher
and the `PERFXPERT_LEGACY` toggle)
- [ ] Live MI300X nightly run (requires hardware; nightly workflow will
refresh baseline)
- [ ] Full interactive TUI (requires TTY; E2E can only prove
banner-emitted)

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
venkat1361 added a commit that referenced this pull request Jun 8, 2026
…rain (#6750)

## Motivation

- Intermittent roctx-pause-resume hang.
```
Thread 0  (SDK: dispatch + serializer)                     | Thread 1  (HSA async completion)
-----------------------------------------------------------+----------------------------------
roctx RESUME  ->  serializer.enable()                      |
Q0 dispatches kernels  0, 1, ... , 10                      |
                                                           | completing Q0 kernels 0..9
                                                           |
roctx PAUSE   ->  serializer.disable()                     |
  set_barrier(): Q0 still has 1 kernel in flight (#10)     |
  => new transition Barrier B  [handle:1]  ARMED (=1)      |
                                                           |
Q1 dispatches 1 kernel + the transition packet             |
  BARRIER_AND  dep_signal = handle:1   (Q1 blocked)        |
                                                           |
                                                           | Q0 kernel #10 completes
                                                           |   -> kernel_completion_signal()
                                                           |   -> Barrier B count hits 0
                                                           |   => handle:1 CLEARED (=0), B.complete()
                                                           |
roctx RESUME  ->  serializer.enable()                      |
  clear_complete_barriers(): B is complete()               |
  -> ~hsa_barrier() DESTROYS handle:1                      |
     (but Q1's transition packet STILL waits on it!)       |
  Q1 has 1 kernel in flight while serialization was off    |
  -> new Barrier B': hsa_signal_create REUSES handle:1     |
  -> set_barrier(): handle:1 ARMED again (=1)              |
                                                           |
*** DEADLOCK ***                                           |
  Q1's old packet waits on handle:1 - now armed by B'      |
  -> Q1 never runs; serializer idle, no token owner        |
-----------------------------------------------------------+----------------------------------

handle:1 lifecycle:  ARMED(B)  ->  CLEARED(0)  ->  DESTROYED  ->  REUSED+ARMED(B')
                     ^------------- same handle, re-armed under Q1's stale packet

Root cause:  handle:1 was destroyed (and reused) while Q1's transition packet still
             referenced it, so Q1 ends up waiting on an unrelated, armed barrier.
Fix:    keep B until Q1 has executed past the dispatch carrying its packet
             -- safe_to_retire() = complete() AND no queue still references the signal.
             
 ```
## Technical Details

A serializer barrier owns an HSA signal that its queues' transition (barrier-AND) packets wait on. The hang occurred when a barrier was retired (signal destroyed) while a queue still held an un-executed transition packet; HSA recycled the freed handle into the next barrier, and if that one was armed the queue blocked on the wrong barrier → deadlock.

Fix: defer retirement until every transition packet has actually executed:

- `hsa_barrier` tracks per-queue the dispatch id of the transition packet it handed out (`_barrier_enqueued` is now a `queue -> dispatch_id map`).
- `Queue` exposes monotonic `serialized_dispatched / serialized_completed` counters so a barrier can tell whether a queue has executed past a given dispatch.
- `drain_queue(queue)` clears a queue's tag once `serialized_completed` reaches its token; it early-exits without taking the lock while the barrier is still armed, since a transition packet can't have executed before its barrier clears. `remove_queue()` clears the tag on teardown
- `safe_to_destroy() = complete()` and no outstanding tags. `clear_complete_barriers()` retires a barrier (destroying its signal) only when `safe_to_destroy()`, so the signal is freed only once nothing references it.
- The destructor enforces this as an invariant: it logs a `ROCP_ERROR` if a barrier is ever destroyed with outstanding tags (should be unreachable given the gating + `remove_queue` on teardown) and then destroys the signal normally, no leak.


## JIRA ID

 ROCM-25255

## Test Plan

- Tests (tests/hsa_barrier.cpp): retirement gated on drain, teardown escape, and signal-handle-not-recycled (fails on the old code, passes on the fix).

## Test Result

<!-- Briefly summarize test outcomes. -->

## Submission Checklist

- [ ] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
pvallem added a commit that referenced this pull request Aug 16, 2026
The plan section-5 scheduler, built on the Phase-3 Rendezvous. Host-validated
(33 pytest pass on Windows + WSL); no GPU needed.

- lib/pipeline.py PipelineScheduler: loader thread (launches ONLY pipeline
  entries, under a BoundedSemaphore init-pool; serial entries are handed straight
  to the executor and never loader-launched), one watcher per in-flight pipeline
  entry, and a single executor thread. Enforces INITIALIZING+READY <= init_pool
  and EXECUTING <= 1.
- Correctness details from the plan: idempotent finish_entry with a claim
  (terminal) / settle split so completion is signalled only after teardown
  (#11); atomic release_slot_if_owned and atomic READY->EXECUTING handoff (#5);
  per-unit executor exception boundary with INFRA_ERROR distinct from a test
  FAILED (#4/#10); loader finally-finalizes every unvisited entry (#3);
  shutdown()/request_stop() where an executor-owned entry is only terminated
  (its executor records the result). Model A: every entry -> exactly one terminal.
- tests/test_scheduler.py: proves the pool + execution bounds post-hoc from
  runner-observed [t_launch,t_go) / [t_go,t_exit) interval overlap, mixed
  pipeline+serial non-overlap, init-overlaps-exec, exit-before-READY, exec
  timeout, launch-fault containment, cancellation race, idempotent finish.

Simple release stream for now; legacy per-parent sibling ordering and the
coordinator eligibility priority structure land with sub-entry expansion.
prasanna-amd added a commit that referenced this pull request Aug 20, 2026
… real headers

- Fix double-deref in KernelCh stop: combine per-channel and
  kernel-completion ref drops into a single atomic operation under the
  coll mutex, preventing negative refcount and use-after-free (#1)

- Add mutex to ProxyOpInfo, protect step timing accumulation from
  concurrent proxy thread writes (#2)

- Lock ProxyOp before memcpy into coll->proxyOps to prevent reading
  partially-written step data (#3)

- Move all pools (coll, proxyOp, proxyStep) from process-global statics
  into per-communicator acclCommContext, eliminating cross-comm pool
  starvation (#4)

- Fix fmt_size to show fractional values (1.5M instead of 1M) (#6)

- Fix bottleneck classifier denominator to use
  launch + max(kernel, proxy) instead of exec + launch, preventing
  percentages exceeding 100% due to kernel/proxy overlap (#7)

- Add --output flag to 'single' subcommand and clean up hasattr
  guard (#8)

- Switch output file from append to write mode to avoid stale data
  from PID reuse (#9)

- Replace vendored nccl/profiler.h with accl_shim.h that provides
  minimal types and includes RCCL's real profiler_v5.h; add
  CMakeLists.txt for in-tree builds (#10)
prasanna-amd added a commit that referenced this pull request Aug 26, 2026
…ntegration

Add monotonic generation counter per pool slot to detect stale callbacks
from reclaimed collectives, resolving the 0==0 race in pool reclaim and
all callback-lifetime concerns (threads #4, #6, #8, #9).

Add atomic ref-count to acclCommContext so acclPluginFinalize defers free()
until all outstanding callbacks have drained (thread #2).

Wire accl plugin into the parent RCCL CMake build (thread #20), add
CXX_VISIBILITY_PRESET/VISIBILITY_INLINES_HIDDEN (thread #1), and bump
ACCL_MAX_CHANNELS from 64 to 256 (thread #11).

Fix acclShouldFinalize: nChannels==0 collectives (onerank path) finalize
immediately on coll stop; guard channelId against nChannels (thread #10, #12).
Free leaked ProxyOp when coll's proxyOpIndices is full (thread #13).
Rename firstCpuStart to firstKernelCpuStartUs for clarity (thread #14).

Fix warmup off-by-one (sn <= warmup → sn < warmup, thread #7), use
try/finally for output file handle (thread #15), fix test fixtures to
start at coll_sn=0 (thread #16), remove stale ACCL_PROFILER_WARMUP_ITERS
docs (thread #17), sync bottleneck categories with classify() (thread #18),
add NVIDIA Apache-2.0 header to accl_shim.h (thread #19).

Add tests: ProxyStep lifecycle, channel bounds, kernel timing assertions
(threads #3, #12, #21).
mch added a commit that referenced this pull request Aug 26, 2026
…on-freed resumption

Rewrite the credit-boundary test to pin the closed-loop behaviour unique to
it: a put blocked for lack of credit issues once a completion frees one
(before: not issued / cis unchanged; after: issued / cis advanced). Rename
CreditBoundary_IssueResumesWhenCreditFreed ->
SinglePut_IssuesOnceCompletionFreesCredit; drop the inflight/request
bookkeeping and FIFO-ordering assertions (Test #10's concern) and simplify to
a single in-flight op.

Co-authored-by: Pi Agent
bwelton added a commit that referenced this pull request Aug 27, 2026
…blished pipe first and is re-probed under the backstop
bwelton added a commit that referenced this pull request Aug 31, 2026
…blished pipe first and is re-probed under the backstop
bwelton added a commit that referenced this pull request Aug 31, 2026
…blished pipe first and is re-probed under the backstop
bwelton added a commit that referenced this pull request Sep 1, 2026
…blished pipe first and is re-probed under the backstop
bwelton added a commit that referenced this pull request Sep 1, 2026
…blished pipe first and is re-probed under the backstop
venkat1361 pushed a commit that referenced this pull request Sep 1, 2026
…10809)

## Summary
Addresses a 15-point static re-review of the KFD dispatch-log
signal-less path (on top of `review-fixes`). Each finding was evaluated
against the code and the prior design history; this PR **fixes the
genuine correctness/safety/resource issues** (potential misattribution,
UAF on terminal teardown, unbounded pairer-map growth, plus
FATAL-handling, env-race, and robustness items) and **documents the ones
intentionally left as accepted residuals or pre-existing**, with
rationale. `+365 / −49` across 9 files.

## Fixed

- **#4 (misattribution) — validate identity before claiming an
unknown-START EOP.** The unknown-START path in
`dispatch_hub.hpp::record_kernel_end` took the sole first-owner entry
with no timestamp check, and terminal-time validation ran only *after*
the entry was consumed/retired — so a stale EOP could claim a newer
dispatch's entry. Now rejects an EOP whose `end_ticks <= window.t_open`
(a kernel cannot end at/before its window opened; same GPU-tick domain
the known-START path already uses) **before** taking the entry, so a
rejected EOP consumes/retires nothing. Fail-first verified.
- **#3 + #2 (UAF) — the terminal fences are now truly terminal
(fail-closed).** `signal_less_fence_completions()` previously quiesced
visible work but did not stop the reader on success, so a still-PENDING
kernel could complete after the client's callback/buffer state
(detach/finalize, F23) or the HSA runtime (final `hsa_shut_down`, F24)
was freed. A new `signal_less_terminal_stop()` (factored from teardown)
latches disable → stops+joins the reader/processor → drains+ledgers
PENDING, and is called from the F23/F24 sites. Verified deadlock-free
(never joins its own task group, holds no lock across the join, joined
threads never block on the joiner) and 5/5 clean under a shutdown
watchdog. The existing `get_fini_status()` re-entry guard (the earlier
crash fix) is preserved.
- **#11 (unbounded growth) — hard size cap on the pairer START map.**
`pair_state::pending_starts` was bounded only by a 30-minute age timer.
Added `ROCPROFILER_KFD_DISPATCH_LOG_MAX_PENDING_STARTS` (default 2M,
shared reject-and-default parser) with oldest-first eviction (recurring
key exempted so the `ambiguous` latch is preserved).
- **#7 (coverage) + #10 (liveness) — FATAL handling.** FATAL now latches
admission and waits for the processor to consume the already-published
pipe **before** draining the hub (so a fatal session's final EOP and
healthy-GPU EOPs behind it aren't dropped), and the FATAL status is
re-probed while the empty-wake backstop is tripped (so a fatal stream
that produces no records is still detected).
- **#5 (robustness) — master switch is a strict fail-closed opt-in.**
`ROCPROFILER_KFD_DISPATCH_LOG_SIGNAL_LESS` now accepts only explicit
true values; anything else is disabled with a one-time warning (no throw
on malformed input).
- **#9 (arg-order) — deterministic GC-gate operand ordering.**
`gc_gate_open`'s two operands are read into named locals in the intended
order rather than relying on unspecified argument-evaluation order.
- **#12 (race) — env knobs primed at serialized init.** The
age/cap/quiesce/switch env reads are populated during reader start-up
rather than lazily on a worker thread.
- **#14(b) — fork child no longer hangs in `interposition_fini()`.** A
normal (non-exec) child now short-circuits `interposition_fini()` under
the existing `fork_stale()` guard, avoiding a wlock on a registry a
vanished parent thread may hold.

## Intentionally not changed (accepted residuals / design decisions /
pre-existing)

- **#1 — teardown coverage loss** (a kernel in flight at exit may emit
no record): the accepted D8/F1 coverage residual. The *UAF* variant of
this concern is #3, which is fixed.
- **#8 — equal-tick START/EOP**: the accepted D1 residual. The code
emits a **no-timing / zero-duration drop**, not a fabricated 1 ns; no
misattribution.
- **#9-main — GC gate "race"**: the copied-but-still-in-ring window is
the accepted **R10** residual (an EOP still in the ring is intentionally
not gated), and cap-eviction's bypass of the in-flight gate is D9's
documented coverage-loss residual. The operand-ordering nit is fixed
(#9-arg above); the residual is by design (coverage loss, never
misattribution).
- **#13 — cross-batch inversion**: the explicitly-accepted D1 residual
(coverage loss under queue churn, never misattribution). A cross-batch
reorder buffer is a larger design change weighed against measured
coverage impact, which the benchmarks do not show hitting.
- **#6 — completion-callback self-deadlock**: a **pre-existing**
reentrancy defect on the generic signal path (a client callback that
calls its own finalize). The new terminal-stop path was specifically
designed **not** to add another instance of it.
- **#14(a) — session mid-construction skipped by a concurrent fork**: a
child-lifetime resource leak (not a hang); the parent is unaffected and
the child drops it at exit. The "fix" would introduce a formal data race
on an `smap` pointer a vanished thread was mid-write on, to reclaim
memory about to be freed — not worth it. Left as-is.
- **#15 — eager arming on a registered (vs active) context**: an
efficiency consideration, not a correctness issue; arming stays gated on
a registered kernel-dispatch context.

## Known residuals in the fixes (documented)
- #4 adds no upper time bound (an implausibly-future EOP is still taken
and rejected by the finalizer as no-timing, never misattributed).
- #10 restores FATAL *detection* under the backstop; a *persistently
failing* status ioctl still isn't fail-closed (separate follow-up).
- #11 eviction is O(live) per over-cap insert (same tradeoff as the D9
cap; only reached under pathological EOP loss).

## Testing (MI350, host ROCm 7.2.1, build `fd06e1407c`)
- Build clean at the project warning level — **0 new warnings**.
- `ctest -L kfd-dlog` — **90/90 pass** (incl. 2 new tests: pairer-map
cap, strict opt-in).
- ThreadSanitizer, all 8 kfd-dlog suites — **90/90, zero reports**
(covers the terminal-stop join, FATAL drain-wait, GC-gate ordering).
- Shutdown crash/hang reproducer (1040), **5 runs under a watchdog — 5/5
clean, no hang, no crash** (the decisive check for the terminal-stop
rework).
- 1041-d (20k kernels ×3), 1031, 1041-a, 1041-c — all pass, no
attribution regression.
- graph-perf — **−44.21%** overhead reduction,
`register-refused=0`/block (no throughput regression).

## Tracking
JIRA ID: AIPROFSDK-1012 AIPROFSDK-1040 AIPROFSDK-1041
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant