mirror of
https://github.com/nestriness/nestri.git
synced 2026-09-27 04:52:25 +03:00
feat(nesdoctor): read the display, and offer early access
Two things, both of which every response collected without them is a response we cannot go back for -- since a submission carries nothing that identifies anyone, there is no second chance to ask. ## The display and decode probe This is the readable half of the client capability probe our build order already specifies -- GPU, decoder, display -- and its stated purpose is attribution: told only that a stream "looks bad", the cheapest available explanation is that our reconstruction ratio was too aggressive, so without this we would lower the ratio and pay density for somebody else's window manager. presentation path x11 · bspwm eDP-1 1920x1200 @ 60 Hz, 8-bit Vulkan decode h264, h265 VA-API decode h264, h265, vp9 Session type, compositor, and whether we are under XWayland -- which is exactly the objection raised against our own A/B rounds, now recorded automatically rather than argued about. A bare window manager sets none of the XDG variables, so bspwm and thirteen others are matched from the process list; a report that cannot name bspwm cannot answer the challenge that named it. From EDID, parsed here rather than shelled out to: native mode, refresh, colour bit depth, which HDR transfer functions the panel accepts, BT.2020 colorimetry, and 4:2:0 chroma. The CTA-861 extension blocks are where all the colour capability lives -- base EDID says nothing about any of it. That decides real choices. Whether 10-bit is worth sending, whether BT.2020 is worth encoding, which codec to reach for. Every one of those has so far been decided against the one panel in this room -- which this now reports as 8-bit, meaning the 10-bit work cannot be validated on it at all. EDID is untrusted binary from a device node. Every read is bounds-checked and every field optional: monitors ship broken EDIDs and docks synthesise worse ones, so a bad panel costs one field rather than the run. Three tests, one of which truncates the block mid-extension and asserts that no colour capability is invented. The colorimetry byte offset was wrong the first time and the test caught it, which is the argument for the test. Present mode, tearing and fractional scaling need a real window and swapchain, so they are absent and said to be absent rather than guessed. ## Early access An optional email, asked last, after the verdict has printed -- so nobody types an address before seeing what this said about their machine. Blank skips it. The offer branches on the verdict, because telling someone with no KVM and a grade-F uplink that we liked what their machine can do is a lie, and this program's only real asset is that it does not flatter anyone. A host-capable machine gets the host offer; everyone else gets early access as a player, which is a true offer too. It is the one identifying thing collected here, so: it appears in the pre-submit disclosure with everything else, and the promise elsewhere had to be reworded -- "no username, no identifiers" stopped being true the moment this field existed, and leaving the old line standing would have been the dishonest option. Validation is deliberately loose; arguing with somebody about their own address over a regex loses the response outright. Version to 0.2.0.
This commit is contained in:
@@ -30,6 +30,7 @@ pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
pub struct Full<'a> {
|
||||
pub nesdoctor: &'static str,
|
||||
pub sys: &'a SysInfo,
|
||||
pub display: &'a crate::display::DisplayReport,
|
||||
pub host: &'a HostReport,
|
||||
pub net: &'a NetReport,
|
||||
pub steam: &'a SteamReport,
|
||||
@@ -544,6 +545,59 @@ pub fn submit_url(base: &str, f_: &Full) -> String {
|
||||
put(k, v.clone());
|
||||
}
|
||||
}
|
||||
// Display and decode. These are what decide the colour and codec choices
|
||||
// on the wire -- until now every one of them was made against the single
|
||||
// panel in one room.
|
||||
let d = f_.display;
|
||||
if let Some(s) = &d.session {
|
||||
put("session", s.clone());
|
||||
}
|
||||
if let Some(c) = &d.compositor {
|
||||
put("wm", c.clone());
|
||||
}
|
||||
if d.xwayland {
|
||||
put("xwayland", "1".into());
|
||||
}
|
||||
if let Some(o) = d.outputs.first() {
|
||||
if let (Some(w), Some(h)) = (o.width, o.height) {
|
||||
put("mode", format!("{w}x{h}"));
|
||||
}
|
||||
if let Some(r) = o.refresh_hz {
|
||||
put("hz", format!("{r:.0}"));
|
||||
}
|
||||
if let Some(b) = o.bit_depth {
|
||||
put("bpc", b.to_string());
|
||||
}
|
||||
if !o.eotf.is_empty() {
|
||||
put("eotf", o.eotf.join(","));
|
||||
}
|
||||
if !o.bt2020.is_empty() {
|
||||
put("bt2020", o.bt2020.join(","));
|
||||
}
|
||||
put(
|
||||
"chroma",
|
||||
match (o.ycbcr420, o.ycbcr444) {
|
||||
(true, true) => "420+444",
|
||||
(true, false) => "420",
|
||||
(false, true) => "444",
|
||||
(false, false) => "-",
|
||||
}
|
||||
.into(),
|
||||
);
|
||||
}
|
||||
if d.outputs.len() > 1 {
|
||||
put("outputs", d.outputs.len().to_string());
|
||||
}
|
||||
if !d.decode.vulkan.is_empty() {
|
||||
put("vkdec", d.decode.vulkan.join(","));
|
||||
}
|
||||
if !d.decode.vaapi.is_empty() {
|
||||
put("vadec", d.decode.vaapi.join(","));
|
||||
}
|
||||
|
||||
if let Some(e) = &answers.email {
|
||||
put("email", e.clone());
|
||||
}
|
||||
put("verdict", verdict.tag().to_string());
|
||||
|
||||
format!("{}/?{}", base.trim_end_matches('/'), q.join("&"))
|
||||
@@ -556,6 +610,7 @@ pub fn submit_url(base: &str, f_: &Full) -> String {
|
||||
pub fn submit_contents(steam: &SteamReport, answers: &Answers) -> Vec<&'static str> {
|
||||
let mut v = vec![
|
||||
"this machine's OS, CPU, RAM and GPU model",
|
||||
"your display's resolution, refresh rate, colour depth and HDR support",
|
||||
"which host requirements passed and which did not",
|
||||
"the network figures you just saw",
|
||||
"free disk space, and how long this machine tends to stay on",
|
||||
@@ -573,7 +628,13 @@ pub fn submit_contents(steam: &SteamReport, answers: &Answers) -> Vec<&'static s
|
||||
{
|
||||
v.push("your answers to the questions");
|
||||
}
|
||||
v.push("no hostname, no IP address, no username, no file paths");
|
||||
// Reworded when the email field landed. The old line said "no username, no
|
||||
// identifiers", which stopped being true, and leaving it up would have been
|
||||
// the dishonest option.
|
||||
if answers.email.is_some() {
|
||||
v.push("the email address you just typed — the only identifying thing here");
|
||||
}
|
||||
v.push("no hostname, no IP address, no file paths, and nothing about your account");
|
||||
v
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user