fix(ci): the unsafe lint said warn while CI enforced it as deny, and main went red
windows-host / package (push) Failing after 13m8s
windows-host / winget-source (push) Skipped
windows-msix / package (arm64, C:\Users\Public\ffmpeg-arm64, --no-default-features, aarch64-pc-windows-msvc, C:\t-a64) (push) Successful in 3m43s
windows-msix / package (x64, C:\Users\Public\ffmpeg, , x86_64-pc-windows-msvc, C:\t) (push) Successful in 3m31s
windows / build (aarch64-pc-windows-msvc) (push) Successful in 4m48s
windows / build (x86_64-pc-windows-msvc) (push) Successful in 5m55s
ci / web (push) Successful in 1m21s
ci / docs-site (push) Successful in 1m5s
android / android (push) Failing after 6m25s
ci / bench (push) Successful in 8m21s
deb / build-publish (push) Successful in 8m44s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 10s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 9s
decky / build-publish (push) Successful in 32s
deb / build-publish-host (push) Successful in 10m2s
ci / rust (push) Failing after 17m18s
ci / rust-arm64 (push) Successful in 16m6s
arch / build-publish (push) Failing after 17m19s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 24s
docker / build-push (ci, ci/rust-ci-noble.Dockerfile, punktfunk-rust-ci-noble) (push) Successful in 7m54s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 7m44s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 11m12s
deb / build-publish-client-arm64 (push) Successful in 14m5s
flatpak / build-publish (push) Failing after 8m59s
apple / swift (push) Failing after 7m20s
apple / screenshots (push) Skipped
rpm / build-publish (43, bazzite, punktfunk-fedora-rpm) (push) Failing after 17m16s
docker / build-push-arm64cross (push) Canceled after 0s
docker / deploy-docs (push) Canceled after 0s
rpm / build-publish (44, fedora-44, punktfunk-fedora44-rpm) (push) Canceled after 26m3s
windows-host / package (push) Failing after 13m8s
windows-host / winget-source (push) Skipped
windows-msix / package (arm64, C:\Users\Public\ffmpeg-arm64, --no-default-features, aarch64-pc-windows-msvc, C:\t-a64) (push) Successful in 3m43s
windows-msix / package (x64, C:\Users\Public\ffmpeg, , x86_64-pc-windows-msvc, C:\t) (push) Successful in 3m31s
windows / build (aarch64-pc-windows-msvc) (push) Successful in 4m48s
windows / build (x86_64-pc-windows-msvc) (push) Successful in 5m55s
ci / web (push) Successful in 1m21s
ci / docs-site (push) Successful in 1m5s
android / android (push) Failing after 6m25s
ci / bench (push) Successful in 8m21s
deb / build-publish (push) Successful in 8m44s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 10s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 9s
decky / build-publish (push) Successful in 32s
deb / build-publish-host (push) Successful in 10m2s
ci / rust (push) Failing after 17m18s
ci / rust-arm64 (push) Successful in 16m6s
arch / build-publish (push) Failing after 17m19s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 24s
docker / build-push (ci, ci/rust-ci-noble.Dockerfile, punktfunk-rust-ci-noble) (push) Successful in 7m54s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 7m44s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 11m12s
deb / build-publish-client-arm64 (push) Successful in 14m5s
flatpak / build-publish (push) Failing after 8m59s
apple / swift (push) Failing after 7m20s
apple / screenshots (push) Skipped
rpm / build-publish (43, bazzite, punktfunk-fedora-rpm) (push) Failing after 17m16s
docker / build-push-arm64cross (push) Canceled after 0s
docker / deploy-docs (push) Canceled after 0s
rpm / build-publish (44, fedora-44, punktfunk-fedora44-rpm) (push) Canceled after 26m3s
`unsafe_op_in_unsafe_fn = "warn"` was adopted workspace-wide in 39513528 on the assumption that
`warn` is a soft setting you can clear at leisure. It is not: ci.yml runs `cargo clippy … -D
warnings`, which promotes it to a hard error, so main has failed on EVERY commit since — Linux
`rust` and `rust-arm64` both dying on `pf-client-core` with 70 E0133 errors, and windows-host.yml
alongside them. A lint level that understates its own severity is worse than a strict one, so this
states what CI already does — `deny` — and writes the exemptions down instead.
Fourteen GPU/FFI backend files take `#![allow(unsafe_op_in_unsafe_fn)]`, each with its reason and
the workspace Cargo.toml carrying the argument in full. They are not "not done yet": measured
across them, 64% of the sites are a single third-party FFI call (ash, pyrowave-sys, libav, the
NVENC/AMF entry tables), and of the 44 `unsafe fn`s only 4 have a body containing no unsafe
operation at all. Since pf-encode also denies `undocumented_unsafe_blocks`, narrowing them means a
hand-written SAFETY comment per line that could only restate the signature — the exact noise that
made `unsafe` stop meaning anything here before. Everything else stays at zero and enforced, and
each allow is removable on its own terms.
Two smaller things this had to clear, both invisible to the job that would have caught them:
- `service.rs`: `undocumented_unsafe_blocks` wants the proof on EACH block, and a comment covering
a group of consecutive `unsafe` statements only credits the first — so the two `OwnedHandle`
wraps became their own statements. Windows-gated, so only the .47 gate sees it. 37a42078 fixed
the same class of failure in pf-frame/dxgi.rs concurrently; that fix is taken as-is here.
- `clients/linux/ui_settings.rs`: `show`'s deletion left its doc comment stranded on `show_scoped`,
which silently merged two unrelated doc blocks onto one fn. Removed.
Verified by running the real CI commands, not proxies: on .21 fmt + `clippy --workspace
--all-targets -- -D warnings` + the feature-gated `-p pf-encode --features
nvenc,vulkan-encode,pyrowave` + build + test, all rc=0; on the Intel box .47 all four
windows-host.yml clippy invocations, all rc=0. The arm64 job lints pf-client-core and
punktfunk-client-linux, both covered here.
This commit is contained in:
+23
-4
@@ -60,11 +60,30 @@ repository = "https://git.unom.io/unom/punktfunk"
|
|||||||
# workspace. `unsafe fn` marks a CONTRACT the caller must uphold; it is not a licence for the whole
|
# workspace. `unsafe fn` marks a CONTRACT the caller must uphold; it is not a licence for the whole
|
||||||
# body to skip checking. Without this lint an `unsafe fn` body is unchecked end to end, so a 600-line
|
# body to skip checking. Without this lint an `unsafe fn` body is unchecked end to end, so a 600-line
|
||||||
# function hides which handful of lines are actually the unsafe ones — exactly the reviewer-hostile
|
# function hides which handful of lines are actually the unsafe ones — exactly the reviewer-hostile
|
||||||
# shape we are working down. `warn` while the remaining sites are cleared crate by crate; flip to
|
# shape we are working down. (This is the Rust 2024 default; adopting it early also pays off the
|
||||||
# `deny` once they are, so it can never regress. (This is the Rust 2024 default; adopting it early
|
# edition migration.)
|
||||||
# also pays off the edition migration.)
|
#
|
||||||
|
# `deny`, not `warn`. `warn` was never actually a softer setting: CI runs `cargo clippy … -D
|
||||||
|
# warnings`, which promotes it to a hard error anyway — that is how adopting this lint turned main
|
||||||
|
# red on every platform for a day without the level in this file ever saying `deny`. A level that
|
||||||
|
# lies about its own severity is worse than a strict one, so this now states what CI already does,
|
||||||
|
# and the exemptions are written down per file instead of hiding in a 689-warning wall nobody reads.
|
||||||
|
#
|
||||||
|
# THE EXEMPTIONS. Fourteen GPU/FFI backend files carry `#![allow(unsafe_op_in_unsafe_fn)]` with a
|
||||||
|
# one-line reason each. They are not "not done yet" — they are where this lint stops paying:
|
||||||
|
# their bodies are ash/CUDA/AMF/libav calls almost line for line (measured: 64% of the sites are a
|
||||||
|
# single third-party FFI call, and of the 44 `unsafe fn`s in them only 4 have a body containing no
|
||||||
|
# unsafe operation at all). Narrowing them means one `unsafe {}` per line plus, since pf-encode also
|
||||||
|
# denies `clippy::undocumented_unsafe_blocks`, one hand-written SAFETY comment per line that could
|
||||||
|
# only ever restate "an ash call on a live device" — the precise noise that made `unsafe` stop
|
||||||
|
# meaning anything here before (see the header of `pf-win-display/src/win_display.rs`).
|
||||||
|
#
|
||||||
|
# Everything else in the workspace is at zero and enforced. Removing one of those allows, file by
|
||||||
|
# file, is real work with a real payoff; blanket-narrowing all fourteen is not. Prefer DELETING an
|
||||||
|
# `unsafe fn` marker over wrapping its body: keep the marker only where a caller can actually break
|
||||||
|
# something (a raw pointer, a borrowed HANDLE, a GPU object that must not be in flight).
|
||||||
[workspace.lints.rust]
|
[workspace.lints.rust]
|
||||||
unsafe_op_in_unsafe_fn = "warn"
|
unsafe_op_in_unsafe_fn = "deny"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
|||||||
@@ -732,10 +732,6 @@ fn group(title: &str, description: &str) -> adw::PreferencesGroup {
|
|||||||
g
|
g
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `on_closed` runs after the settings are saved (the app shell refreshes the hosts grid
|
|
||||||
/// there so the library toggle takes effect without a nav round-trip). `probes` is the
|
|
||||||
/// shell's startup device probe (`AppModel::probes`) — may still be empty. Returns the
|
|
||||||
/// presented dialog so the screenshot harness can select a page; callers ignore it.
|
|
||||||
/// The dialog in a given [`Scope`]. `on_scope` asks the app to re-open it in another one:
|
/// The dialog in a given [`Scope`]. `on_scope` asks the app to re-open it in another one:
|
||||||
/// switching scope closes this dialog first, so the layer being edited is committed before
|
/// switching scope closes this dialog first, so the layer being edited is committed before
|
||||||
/// the next one is loaded, and there is exactly one place that builds the rows.
|
/// the next one is loaded, and there is exactly one place that builds the rows.
|
||||||
|
|||||||
@@ -29,6 +29,13 @@
|
|||||||
//! rings are retired, not destroyed — the presenter may still hold their views (see
|
//! rings are retired, not destroyed — the presenter may still hold their views (see
|
||||||
//! [`RETIRE_HANDOVERS`]).
|
//! [`RETIRE_HANDOVERS`]).
|
||||||
|
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is `pyrowave-sys` C-API and ash/Vulkan compute calls almost line for line;
|
||||||
|
// narrowing it would add one `unsafe {}` plus one SAFETY comment per call that could only restate
|
||||||
|
// the signature. Clearing this file means DELETING the markers that carry no caller contract, not
|
||||||
|
// wrapping the calls — until then the lint is off HERE and enforced everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
|
|
||||||
use crate::video::{ColorDesc, VulkanDecodeDevice};
|
use crate::video::{ColorDesc, VulkanDecodeDevice};
|
||||||
use anyhow::{bail, Context as _, Result};
|
use anyhow::{bail, Context as _, Result};
|
||||||
use ash::vk;
|
use ash::vk;
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
//! FFmpeg Vulkan Video decode over the presenter's own VkDevice (zero-copy VkImage).
|
//! FFmpeg Vulkan Video decode over the presenter's own VkDevice (zero-copy VkImage).
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is raw libav + ash calls on the presenter's VkDevice almost line for line;
|
||||||
|
// narrowing it would add one `unsafe {}` plus one SAFETY comment per call that could only restate
|
||||||
|
// the signature. Clearing this file means DELETING the markers that carry no caller contract, not
|
||||||
|
// wrapping the calls — until then the lint is off HERE and enforced everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
#![allow(clippy::unnecessary_cast)]
|
#![allow(clippy::unnecessary_cast)]
|
||||||
|
|
||||||
use crate::video::{
|
use crate::video::{
|
||||||
|
|||||||
@@ -8,6 +8,12 @@
|
|||||||
//! does *not* accept — we expand it to `rgb0` (one padding byte/pixel, no colour math).
|
//! does *not* accept — we expand it to `rgb0` (one padding byte/pixel, no colour math).
|
||||||
//! The encoder is opened *without* a global header so VPS/SPS/PPS are emitted in-band on
|
//! The encoder is opened *without* a global header so VPS/SPS/PPS are emitted in-band on
|
||||||
//! every IDR — the output is both a playable raw Annex-B stream and self-contained AUs.
|
//! every IDR — the output is both a playable raw Annex-B stream and self-contained AUs.
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is raw libav (`ffmpeg-sys-next`) hwcontext calls almost line for line;
|
||||||
|
// narrowing it would add one `unsafe {}` plus one SAFETY comment per call that could only restate
|
||||||
|
// the signature. Clearing this file means DELETING the markers that carry no caller contract, not
|
||||||
|
// wrapping the calls — until then the lint is off HERE and enforced everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
// Every `unsafe` block in this file carries a `// SAFETY:` proof; enforce it (unsafe-proof program).
|
// Every `unsafe` block in this file carries a `// SAFETY:` proof; enforce it (unsafe-proof program).
|
||||||
#![deny(clippy::undocumented_unsafe_blocks)]
|
#![deny(clippy::undocumented_unsafe_blocks)]
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,12 @@
|
|||||||
//! starts driver-less (the `.so` resolves at runtime — on an AMD/Intel box [`try_api`] fails cleanly
|
//! starts driver-less (the `.so` resolves at runtime — on an AMD/Intel box [`try_api`] fails cleanly
|
||||||
//! and the VAAPI/software backends carry the session).
|
//! and the VAAPI/software backends carry the session).
|
||||||
|
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is raw CUDA driver + `nvEncodeAPI` entry-table calls almost line for line;
|
||||||
|
// narrowing it would add one `unsafe {}` plus one SAFETY comment per call that could only restate
|
||||||
|
// the signature. Clearing this file means DELETING the markers that carry no caller contract, not
|
||||||
|
// wrapping the calls — until then the lint is off HERE and enforced everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
// Every `unsafe` block / impl in this file carries a `// SAFETY:` proof; enforce it.
|
// Every `unsafe` block / impl in this file carries a `// SAFETY:` proof; enforce it.
|
||||||
#![deny(clippy::undocumented_unsafe_blocks)]
|
#![deny(clippy::undocumented_unsafe_blocks)]
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,13 @@
|
|||||||
//! on every AU. NOTE: until Phase 2 lands `CODEC_PYROWAVE` negotiation + a client decoder,
|
//! on every AU. NOTE: until Phase 2 lands `CODEC_PYROWAVE` negotiation + a client decoder,
|
||||||
//! no shipping client can decode this — the backend is reachable only via an explicit
|
//! no shipping client can decode this — the backend is reachable only via an explicit
|
||||||
//! `PUNKTFUNK_ENCODER=pyrowave` and logs that loudly.
|
//! `PUNKTFUNK_ENCODER=pyrowave` and logs that loudly.
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is `pyrowave-sys` C-API and ash/Vulkan compute calls almost line for line;
|
||||||
|
// narrowing it would add one `unsafe {}` plus one SAFETY comment per call that could only restate
|
||||||
|
// the signature. Clearing this file means DELETING the markers that carry no caller contract, not
|
||||||
|
// wrapping the calls — until then the lint is off HERE and enforced everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
|
|
||||||
// Every unsafe block in this module carries a `// SAFETY:` proof (parent module enforces it).
|
// Every unsafe block in this module carries a `// SAFETY:` proof (parent module enforces it).
|
||||||
|
|
||||||
use super::vk_util::{
|
use super::vk_util::{
|
||||||
|
|||||||
@@ -19,6 +19,13 @@
|
|||||||
//! hwdevice/hwframes/buffersrc/buffersink calls go through `ffmpeg::ffi` (= `ffmpeg_sys_next`),
|
//! hwdevice/hwframes/buffersrc/buffersink calls go through `ffmpeg::ffi` (= `ffmpeg_sys_next`),
|
||||||
//! as the CUDA encode path and the clients' decode paths already do. The encoder is opened
|
//! as the CUDA encode path and the clients' decode paths already do. The encoder is opened
|
||||||
//! *without* a global header, so VPS/SPS/PPS are in-band on every IDR.
|
//! *without* a global header, so VPS/SPS/PPS are in-band on every IDR.
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is raw libav (`ffmpeg-sys-next`) calls on borrowed AVFrame/AVBuffer
|
||||||
|
// pointers almost line for line; narrowing it would add one `unsafe {}` plus one SAFETY comment per
|
||||||
|
// call that could only restate the signature. Clearing this file means DELETING the markers that
|
||||||
|
// carry no caller contract, not wrapping the calls — until then the lint is off HERE and enforced
|
||||||
|
// everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
// Every `unsafe` block in this file carries a `// SAFETY:` proof; enforce it (unsafe-proof program).
|
// Every `unsafe` block in this file carries a `// SAFETY:` proof; enforce it (unsafe-proof program).
|
||||||
#![deny(clippy::undocumented_unsafe_blocks)]
|
#![deny(clippy::undocumented_unsafe_blocks)]
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,13 @@
|
|||||||
//! visibility churn, and ~800 lines of construction `unsafe` get their own review surface.
|
//! visibility churn, and ~800 lines of construction `unsafe` get their own review surface.
|
||||||
//! Steady-state encode logic stays in the parent.
|
//! Steady-state encode logic stays in the parent.
|
||||||
|
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is raw ash/Vulkan object construction and bitstream writing almost line
|
||||||
|
// for line; narrowing it would add one `unsafe {}` plus one SAFETY comment per call that could only
|
||||||
|
// restate the signature. Clearing this file means DELETING the markers that carry no caller
|
||||||
|
// contract, not wrapping the calls — until then the lint is off HERE and enforced everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
|
|
||||||
// The parent's whole item namespace (Frame, the consts, sibling helpers) — the point of the
|
// The parent's whole item namespace (Frame, the consts, sibling helpers) — the point of the
|
||||||
// child-module shape. External imports are this file's own; `vk_util` is a crate-root sibling,
|
// child-module shape. External imports are this file's own; `vk_util` is a crate-root sibling,
|
||||||
// so the path is `crate::`, not the parent-relative `super::` the parent uses.
|
// so the path is `crate::`, not the parent-relative `super::` the parent uses.
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
//! Small ash/Vulkan leaf helpers shared by the Linux Vulkan encode backends
|
//! Small ash/Vulkan leaf helpers shared by the Linux Vulkan encode backends
|
||||||
//! (`vulkan_video.rs`, `pyrowave.rs`) — extracted verbatim from `vulkan_video.rs`
|
//! (`vulkan_video.rs`, `pyrowave.rs`) — extracted verbatim from `vulkan_video.rs`
|
||||||
//! when the PyroWave backend arrived so the two don't fork copies.
|
//! when the PyroWave backend arrived so the two don't fork copies.
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is raw ash/Vulkan object construction almost line for line; narrowing it
|
||||||
|
// would add one `unsafe {}` plus one SAFETY comment per call that could only restate the signature.
|
||||||
|
// Clearing this file means DELETING the markers that carry no caller contract, not wrapping the
|
||||||
|
// calls — until then the lint is off HERE and enforced everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
|
|
||||||
// Every unsafe block carries a `// SAFETY:` proof (parent module enforces it).
|
// Every unsafe block carries a `// SAFETY:` proof (parent module enforces it).
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
|||||||
@@ -10,6 +10,12 @@
|
|||||||
//! VAAPI instead). Proven end-to-end in `punktfunk-planning/design/vkenc-probe-harness`.
|
//! VAAPI instead). Proven end-to-end in `punktfunk-planning/design/vkenc-probe-harness`.
|
||||||
//! Opt-in via `PUNKTFUNK_VULKAN_ENCODE`; gated to HEVC/AV1 + a device that advertises the encode op.
|
//! Opt-in via `PUNKTFUNK_VULKAN_ENCODE`; gated to HEVC/AV1 + a device that advertises the encode op.
|
||||||
//! The AV1 encode structs our pinned `ash 0.38` predates are vendored in `vk_av1_encode.rs`.
|
//! The AV1 encode structs our pinned `ash 0.38` predates are vendored in `vk_av1_encode.rs`.
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is raw ash/Vulkan Video calls against an app-owned DPB almost line for
|
||||||
|
// line; narrowing it would add one `unsafe {}` plus one SAFETY comment per call that could only
|
||||||
|
// restate the signature. Clearing this file means DELETING the markers that carry no caller
|
||||||
|
// contract, not wrapping the calls — until then the lint is off HERE and enforced everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
#![allow(clippy::too_many_arguments)]
|
#![allow(clippy::too_many_arguments)]
|
||||||
|
|
||||||
use super::vk_util::{
|
use super::vk_util::{
|
||||||
|
|||||||
@@ -5,6 +5,13 @@
|
|||||||
//! `libloading`), the device binding (D3D11 vs CUDA), input-surface registration, and the
|
//! `libloading`), the device binding (D3D11 vs CUDA), input-surface registration, and the
|
||||||
//! Windows-only async retrieve — stay in their backends. Sibling of [`super::nvenc_status`].
|
//! Windows-only async retrieve — stay in their backends. Sibling of [`super::nvenc_status`].
|
||||||
|
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is raw `nvEncodeAPI` entry-table calls almost line for line; narrowing it
|
||||||
|
// would add one `unsafe {}` plus one SAFETY comment per call that could only restate the signature.
|
||||||
|
// Clearing this file means DELETING the markers that carry no caller contract, not wrapping the
|
||||||
|
// calls — until then the lint is off HERE and enforced everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
|
|
||||||
use super::Codec;
|
use super::Codec;
|
||||||
use nvidia_video_codec_sdk::sys::nvEncodeAPI as nv;
|
use nvidia_video_codec_sdk::sys::nvEncodeAPI as nv;
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,12 @@
|
|||||||
//! fallback + `PUNKTFUNK_AMF_FFMPEG` hatch are gone). 4:4:4 is **permanently** out: VCN hardware
|
//! fallback + `PUNKTFUNK_AMF_FFMPEG` hatch are gone). 4:4:4 is **permanently** out: VCN hardware
|
||||||
//! does not encode 4:4:4.
|
//! does not encode 4:4:4.
|
||||||
|
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is raw AMF COM-style vtable calls through `*mut AmfComponent` almost line
|
||||||
|
// for line; narrowing it would add one `unsafe {}` plus one SAFETY comment per call that could only
|
||||||
|
// restate the signature. Clearing this file means DELETING the markers that carry no caller
|
||||||
|
// contract, not wrapping the calls — until then the lint is off HERE and enforced everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
// Every `unsafe` block / impl in this file carries a `// SAFETY:` proof; enforce it.
|
// Every `unsafe` block / impl in this file carries a `// SAFETY:` proof; enforce it.
|
||||||
#![deny(clippy::undocumented_unsafe_blocks)]
|
#![deny(clippy::undocumented_unsafe_blocks)]
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,13 @@
|
|||||||
//! through `ffmpeg::ffi` (= `ffmpeg_sys_next`), exactly as the Linux CUDA/VAAPI paths do. The
|
//! through `ffmpeg::ffi` (= `ffmpeg_sys_next`), exactly as the Linux CUDA/VAAPI paths do. The
|
||||||
//! `AVD3D11VADeviceContext`/`AVD3D11VAFramesContext` layouts are mirrored (the bindings don't
|
//! `AVD3D11VADeviceContext`/`AVD3D11VAFramesContext` layouts are mirrored (the bindings don't
|
||||||
//! allowlist `hwcontext_d3d11va.h`), as [`super::linux`] mirrors `AVCUDADeviceContext`.
|
//! allowlist `hwcontext_d3d11va.h`), as [`super::linux`] mirrors `AVCUDADeviceContext`.
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is raw libav (`ffmpeg-sys-next`) calls on borrowed hwcontext pointers
|
||||||
|
// almost line for line; narrowing it would add one `unsafe {}` plus one SAFETY comment per call
|
||||||
|
// that could only restate the signature. Clearing this file means DELETING the markers that carry
|
||||||
|
// no caller contract, not wrapping the calls — until then the lint is off HERE and enforced
|
||||||
|
// everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
// Every `unsafe` block in this file carries a `// SAFETY:` proof; enforce it (unsafe-proof program).
|
// Every `unsafe` block in this file carries a `// SAFETY:` proof; enforce it (unsafe-proof program).
|
||||||
#![deny(clippy::undocumented_unsafe_blocks)]
|
#![deny(clippy::undocumented_unsafe_blocks)]
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,12 @@
|
|||||||
//! AU completes within the same tick and `poll` picks it up); under contention completed frames
|
//! AU completes within the same tick and `poll` picks it up); under contention completed frames
|
||||||
//! queue instead of stalling capture — throughput recovers up to the scheduler-granted share.
|
//! queue instead of stalling capture — throughput recovers up to the scheduler-granted share.
|
||||||
|
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is raw `nvEncodeAPI` entry-table + D3D11 calls almost line for line;
|
||||||
|
// narrowing it would add one `unsafe {}` plus one SAFETY comment per call that could only restate
|
||||||
|
// the signature. Clearing this file means DELETING the markers that carry no caller contract, not
|
||||||
|
// wrapping the calls — until then the lint is off HERE and enforced everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
// Every `unsafe` block / impl in this file carries a `// SAFETY:` proof; enforce it.
|
// Every `unsafe` block / impl in this file carries a `// SAFETY:` proof; enforce it.
|
||||||
#![deny(clippy::undocumented_unsafe_blocks)]
|
#![deny(clippy::undocumented_unsafe_blocks)]
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,13 @@
|
|||||||
//! The capture side (a BGRA→YUV CSC into two shareable plane textures + a shared fence, gated on the
|
//! The capture side (a BGRA→YUV CSC into two shareable plane textures + a shared fence, gated on the
|
||||||
//! pyrowave session flag) lives in `pf-capture` (`windows/idd_push.rs`); the CbCr plane + fence ride
|
//! pyrowave session flag) lives in `pf-capture` (`windows/idd_push.rs`); the CbCr plane + fence ride
|
||||||
//! the frame on [`pf_frame::dxgi::D3d11Frame::pyro`], the Y plane on `D3d11Frame::texture`.
|
//! the frame on [`pf_frame::dxgi::D3d11Frame::pyro`], the Y plane on `D3d11Frame::texture`.
|
||||||
|
// UNSAFE-LINT EXEMPTION (rationale + exit criteria: `unsafe_op_in_unsafe_fn` in the workspace
|
||||||
|
// Cargo.toml). This body is `pyrowave-sys` C-API plus D3D11/Vulkan interop calls almost line for
|
||||||
|
// line; narrowing it would add one `unsafe {}` plus one SAFETY comment per call that could only
|
||||||
|
// restate the signature. Clearing this file means DELETING the markers that carry no caller
|
||||||
|
// contract, not wrapping the calls — until then the lint is off HERE and enforced everywhere else.
|
||||||
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
|
|
||||||
// Every `unsafe` block in this module carries a `// SAFETY:` proof (the crate root enforces it).
|
// Every `unsafe` block in this module carries a `// SAFETY:` proof (the crate root enforces it).
|
||||||
|
|
||||||
use crate::pyrowave_wire;
|
use crate::pyrowave_wire;
|
||||||
|
|||||||
@@ -658,11 +658,14 @@ unsafe fn spawn_host(
|
|||||||
|
|
||||||
// Take ownership of the process + thread handles the API filled into `pi`; the returned `Child`
|
// Take ownership of the process + thread handles the API filled into `pi`; the returned `Child`
|
||||||
// closes BOTH on drop, so the supervise loop no longer hand-closes them in its match arms.
|
// closes BOTH on drop, so the supervise loop no longer hand-closes them in its match arms.
|
||||||
// SAFETY: `created` was `Ok`, so `pi` holds two distinct owned handles that nothing else closes;
|
// SAFETY: `created` was `Ok`, so `pi.hProcess` is an owned handle nothing else closes; wrapping
|
||||||
// wrapping each transfers that ownership to an `OwnedHandle`, which closes it exactly once.
|
// it transfers that ownership to the `OwnedHandle`, which closes it exactly once.
|
||||||
|
let process = unsafe { OwnedHandle::from_raw_handle(pi.hProcess.0) };
|
||||||
|
// SAFETY: the same, for the distinct thread handle `CreateProcessAsUserW` filled in.
|
||||||
|
let thread = unsafe { OwnedHandle::from_raw_handle(pi.hThread.0) };
|
||||||
Ok(Child {
|
Ok(Child {
|
||||||
process: unsafe { OwnedHandle::from_raw_handle(pi.hProcess.0) },
|
process,
|
||||||
_thread: unsafe { OwnedHandle::from_raw_handle(pi.hThread.0) },
|
_thread: thread,
|
||||||
pid: pi.dwProcessId,
|
pid: pi.dwProcessId,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user