Skip to content

task: capture SYCL sources in the Coverity scan - #2401

Open
jharlow-intel wants to merge 1 commit into
masterfrom
task/coverity-intel-comptype
Open

jharlow-intel wants to merge 1 commit into
masterfrom
task/coverity-intel-comptype

Conversation

@jharlow-intel

Copy link
Copy Markdown
Contributor

The weekly Coverity scan reports Emitted 18 C/C++ compilation units (46%), and counted per source it captures only 9 of dpctl's 30. The generic clangcc/clangcxx templates parse the SYCL headers without SYCL mode, so units fail on device-only builtins like __ocl_sampler_t. Found while reviewing IntelPython/dpnp#3070, which copied this setup.

  • Register icx/icpx with Coverity's native Intel oneAPI compiler type (intel_icx:linux in the current Scan build tool), as mkl_umath does. That captures all 30 sources.
  • That type also emits a spir64 device pass per SYCL source, which the Scan emitter cannot parse. The device passes keep the Emitted (P%) total at 66%, so the job now fails unless every project source has a completed emit, instead of only on zero units.
  • Skip the upload on non-master refs, so a branch dispatch checks the capture without replacing master's results on the dashboard.
  • Drop rm -rf _skbuild, a no-op on a fresh checkout.

Validation, dispatched on this branch: run 40340192472 reports 30 of 30 sources and skips the upload. The same check fails on the current master log (9 of 30).

…Coverity

The generic clangcc/clangcxx templates parse the SYCL headers without
SYCL mode, so most SYCL sources fail to emit: the weekly scan reports
46% of units, and only 9 of the 30 project sources are captured at all.
Register icx/icpx with Coverity's Intel oneAPI compiler type instead, as
mkl_umath does.

That type emits each SYCL source as a host pass and a spir64 device
pass, and the Scan build tool cannot parse the device pass, so the
overall percentage stays at 66% even with every source captured. Fail
the job unless every project source has a completed emit, so a partial
capture does not use up a scan, and skip the upload on feature-branch
dispatches so they validate capture without replacing master's results.
Drop the _skbuild removal, a no-op on a fresh checkout.
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 74.989%. remained the same — task/coverity-intel-comptype into master

@github-actions

Copy link
Copy Markdown

Comment on lines +87 to +94
# Register icx/icpx with Coverity's native Intel oneAPI compiler type.
# The generic clangcc/clangcxx templates parse <sycl/sycl.hpp> without
# SYCL mode and fail on device-only builtins (__ocl_sampler_t,
# __ocl_image2d_ro_t, ...), which left 21 of 30 sources uncaptured.
# The native type emits each SYCL source twice, as a host pass and a
# spir64 device pass; see the capture check below for the latter.
# intel_oneapi_icx is current; intel_icx:linux is the older spelling
# the Scan build tool still ships (what mkl_umath's scan resolves to).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we shorten this comment?

Comment on lines +108 to +110
# With --template, --compiler takes a bare executable name; capture
# matches on the name of the spawned executable, so this also covers
# the absolute icx/icpx paths CMake resolves.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, very verbose

Comment on lines +130 to +139
# A partial capture still uploads happily and uses up a scan, so
# require every project source to be emitted. This is checked per
# source rather than via the "Emitted N (P%)" total because that
# total also counts the spir64 device passes, which the Scan build
# tool's emitter cannot parse (it trips over and then crashes in the
# SPIR-V builtin headers), capping P at 66% here. The host pass of
# each source is what gets analyzed. CMake's own try-compile probes
# under CMakeFiles/ are not project code and often fail.
# `|| true` because a no-match grep would otherwise trip pipefail and
# end the step before the errors below are printed.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also quite verbose

This branch has not been deployed

No deployments
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.

3 participants