aienos.com
Source of www.aienos.com, served from my own hardware
Brought by drakestapleton
aienos.com / crates / site-builder / src / components / discovery.rs
| 1 | //! /discovery/ : "Scientific Discovery", the examinations of representation |
| 2 | //! discovery (synthesis handoff section 7). Each exam's badge comes from the |
| 3 | //! matching implementation row in data/research_status.json. An exam with no |
| 4 | //! row gets no badge and says so in plain words. |
| 5 | |
| 6 | use maud::{html, Markup}; |
| 7 | |
| 8 | use super::narrative::class_badge; |
| 9 | use super::research_status::{data, ImplementationRow}; |
| 10 | |
| 11 | pub const TITLE: &str = "Scientific Discovery | AienOS"; |
| 12 | pub const DESCRIPTION: &str = "Physics Zero, Dirac, Zeta and supersymmetry as examinations of representation discovery. Aien is never given the named answer; it must earn the structure."; |
| 13 | pub const URL: &str = "https://www.aienos.com/discovery/"; |
| 14 | |
| 15 | pub const NAMED_ANSWER_RULE: &str = |
| 16 | "Never give Aien the named answer when the experiment is intended to test discovery."; |
| 17 | |
| 18 | /// Shown in place of a badge when the research status record has no row. |
| 19 | pub const NOT_ON_RECORD: &str = "Not on the status record yet."; |
| 20 | |
| 21 | pub struct Exam { |
| 22 | pub id: &'static str, |
| 23 | pub name: &'static str, |
| 24 | /// Implementation row id in the research status record, if it has one. |
| 25 | pub record_id: Option<&'static str>, |
| 26 | pub summary: &'static [&'static str], |
| 27 | pub capabilities: &'static [&'static str], |
| 28 | } |
| 29 | |
| 30 | pub const EXAMS: &[Exam] = &[ |
| 31 | Exam { |
| 32 | id: "physics-zero", |
| 33 | name: "Physics Zero", |
| 34 | record_id: Some("Full Physics Zero"), |
| 35 | summary: &[ |
| 36 | "Physics Zero comes last in the order of work. Like the other exams, it will follow the rule above.", |
| 37 | "It will be an examination of representation discovery: Aien will not be given the named answer, and a structure will count only if it earns explanatory power on behavior it has not seen.", |
| 38 | ], |
| 39 | capabilities: &[], |
| 40 | }, |
| 41 | Exam { |
| 42 | id: "dirac", |
| 43 | name: "Dirac", |
| 44 | record_id: None, |
| 45 | summary: &[ |
| 46 | "There will be no Dirac primitive. The exam will provide generic capabilities and test whether the Dirac structure emerges because it earns explanatory power.", |
| 47 | ], |
| 48 | capabilities: &[ |
| 49 | "complex values", |
| 50 | "multi-component state", |
| 51 | "linear operators", |
| 52 | "matrix composition", |
| 53 | "noncommutative composition", |
| 54 | "commutators and anticommutators", |
| 55 | "metric and signature", |
| 56 | "differential operators", |
| 57 | "constraints", |
| 58 | "basis transformations", |
| 59 | ], |
| 60 | }, |
| 61 | Exam { |
| 62 | id: "zeta", |
| 63 | name: "Zeta and spectral geometry", |
| 64 | record_id: Some("SUSY / Zeta rediscovery"), |
| 65 | summary: &[ |
| 66 | "The machine will not be taught the Riemann hypothesis, Zeta Space or the critical line. The exam will test representation transitions: analytic, then operator, then spectral, then geometric or topological.", |
| 67 | "A transition will count only if it improves withheld explanatory performance after its complexity is charged.", |
| 68 | ], |
| 69 | capabilities: &[ |
| 70 | "complex analysis", |
| 71 | "operators", |
| 72 | "spectra", |
| 73 | "graphs", |
| 74 | "topology", |
| 75 | "group action", |
| 76 | "noncommutative composition", |
| 77 | "integral transforms", |
| 78 | "symmetry constraints", |
| 79 | ], |
| 80 | }, |
| 81 | Exam { |
| 82 | id: "susy", |
| 83 | name: "Supersymmetry", |
| 84 | record_id: Some("SUSY / Zeta rediscovery"), |
| 85 | summary: &[ |
| 86 | "There will be no hard-coded supersymmetry theory. The exam will ask whether the system discovers a relationship between classes of state because that relationship compresses unseen behavior.", |
| 87 | ], |
| 88 | capabilities: &[ |
| 89 | "graded structures", |
| 90 | "multiple state sectors", |
| 91 | "graded commutators", |
| 92 | "Grassmann-style machinery", |
| 93 | "symmetry generators", |
| 94 | "field and operator relations", |
| 95 | ], |
| 96 | }, |
| 97 | ]; |
| 98 | |
| 99 | fn record(exam: &Exam) -> Option<&'static ImplementationRow> { |
| 100 | exam.record_id.and_then(|id| data().implementation_row(id)) |
| 101 | } |
| 102 | |
| 103 | pub fn render_discovery() -> Markup { |
| 104 | html! { |
| 105 | article class="narr-page" { |
| 106 | div class="narr-column" { |
| 107 | header class="narr-header" { |
| 108 | p class="narr-kicker" { "Scientific Discovery" } |
| 109 | h1 class="narr-title" { "Examinations of representation discovery" } |
| 110 | p class="narr-standfirst" { |
| 111 | "Physics Zero, Dirac, Zeta and supersymmetry are examinations the program means to run. None of them is an Aien feature. Each one will test whether the machine can find a representation because it explains unseen observations better, after paying for its own complexity." |
| 112 | } |
| 113 | } |
| 114 | section id="rule" class="narr-section" aria-labelledby="rule-heading" { |
| 115 | h2 id="rule-heading" { "The rule" } |
| 116 | blockquote class="narr-rule" { p { (NAMED_ANSWER_RULE) } } |
| 117 | p { |
| 118 | "Each exam will supply generic mathematical machinery instead of the answer. A structure that emerges will count only if it earns positive Turings on held-out data. " |
| 119 | a href="/machine/#turing" { "How the Turing scores." } |
| 120 | } |
| 121 | p { |
| 122 | "Each exam carries its entry from the " |
| 123 | a href="/research/status/#implementation" { "research status record" } |
| 124 | ", where one exists." |
| 125 | } |
| 126 | } |
| 127 | @for exam in EXAMS.iter() { |
| 128 | section id=(exam.id) class="narr-section narr-exam" aria-labelledby=(format!("{}-heading", exam.id)) { |
| 129 | h2 id=(format!("{}-heading", exam.id)) { |
| 130 | (exam.name) |
| 131 | @if let Some(row) = record(exam) { |
| 132 | " " (class_badge(row)) |
| 133 | } |
| 134 | } |
| 135 | @if record(exam).is_none() { |
| 136 | p class="narr-norecord" { (NOT_ON_RECORD) } |
| 137 | } |
| 138 | @for para in exam.summary.iter() { |
| 139 | p { (para) } |
| 140 | } |
| 141 | @if !exam.capabilities.is_empty() { |
| 142 | h3 { "Generic capabilities it will receive" } |
| 143 | ul class="narr-caps" { |
| 144 | @for cap in exam.capabilities.iter() { |
| 145 | li { (cap) } |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | } |
| 151 | section id="later" class="narr-section" aria-labelledby="later-heading" { |
| 152 | h2 id="later-heading" { "When" } |
| 153 | p { |
| 154 | "The full design of these exams belongs to a later phase of the program, after the general mathematical machinery exists. Until then they remain designs and open questions. " |
| 155 | a href="/machine/#today" { "See what exists today." } |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | } |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | #[cfg(test)] |
| 164 | mod tests { |
| 165 | use super::*; |
| 166 | use crate::components::narrative::check::stray_status_words; |
| 167 | use crate::layouts::base::render_page_layout; |
| 168 | |
| 169 | fn page() -> String { |
| 170 | render_page_layout(TITLE, DESCRIPTION, URL, "article", html! {}, render_discovery()).into_string() |
| 171 | } |
| 172 | |
| 173 | /// Every exam that names a record id must find that row, so a typo or a |
| 174 | /// renamed row cannot quietly drop a badge. Exams without a row show the |
| 175 | /// plain "not on the record" line instead. |
| 176 | #[test] |
| 177 | fn exam_badges_come_from_the_data() { |
| 178 | let p = page(); |
| 179 | for exam in EXAMS.iter() { |
| 180 | match exam.record_id { |
| 181 | Some(id) => { |
| 182 | let row = data() |
| 183 | .implementation_row(id) |
| 184 | .unwrap_or_else(|| panic!("{} names record id {id}, which the data does not have", exam.name)); |
| 185 | assert!(p.contains(&class_badge(row).into_string()), "{} badge missing", exam.name); |
| 186 | } |
| 187 | None => { |
| 188 | let start = p.find(&format!("id=\"{}\"", exam.id)).expect("exam section missing"); |
| 189 | let end = start + p[start..].find("</section>").expect("exam section not closed"); |
| 190 | assert!(p[start..end].contains(NOT_ON_RECORD), "{} needs the not-on-record line", exam.name); |
| 191 | } |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | /// No status word on /discovery/ may come from anywhere but the data. |
| 197 | #[test] |
| 198 | fn no_hand_written_status_words() { |
| 199 | let body = render_discovery().into_string(); |
| 200 | let badges: Vec<String> = data().implementation_rows.iter().map(|r| class_badge(r).into_string()).collect(); |
| 201 | let stray = stray_status_words(&body, &badges); |
| 202 | assert!(stray.is_empty(), "hand-written status words on /discovery/: {stray:?}"); |
| 203 | } |
| 204 | |
| 205 | #[test] |
| 206 | fn named_answer_rule_is_present() { |
| 207 | assert!(page().contains(NAMED_ANSWER_RULE)); |
| 208 | } |
| 209 | |
| 210 | #[test] |
| 211 | fn no_em_or_en_dashes() { |
| 212 | let p = page(); |
| 213 | assert!(!p.contains('\u{2014}'), "em dash in /discovery/"); |
| 214 | assert!(!p.contains('\u{2013}'), "en dash in /discovery/"); |
| 215 | } |
| 216 | } |