It seems like the cycle_initial of a query can be called more than once, if
the query alternates between being a cycle head and not being one. To start
with, here's example of a mutually recursive Salsa program that eventually
stabilizes, by fixpoint-iterating an integer until it reaches some upper bound
(3). Then there's a modified version of that program that makes the inner
query sometimes call itself directly. This version never stabilizes, because
the directly recursive call always returns cycle_initial (0). I find that
surprising. Is this an intended behavior?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::alloc::{Layout, alloc, dealloc}; | |
| use std::mem::{self, MaybeUninit}; | |
| use std::ops::{Deref, DerefMut}; | |
| use std::slice; | |
| pub struct FixedVec<'a, T> { | |
| buf: &'a mut [MaybeUninit<T>], | |
| len: usize, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use core::pin::pin; | |
| use core::sync::atomic::{AtomicBool, Ordering::Relaxed}; | |
| use core::task::Poll; | |
| async fn foo() -> std::io::Result<i32> { | |
| let no_return = AtomicBool::new(false); | |
| let mut value = None; | |
| let mut fut = pin!(async { | |
| value = Some({ | |
| // begin user code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0eNrtnd1uI7kRRl9loWtp0fwn5zLJEyTIVbAYyLYyK6xGcmR5N4tg3j3qVsv2WqR8PlkOFkmuxu2RjqtZZDXrh9X/mtysHhf32+V69/lms/lp8ulfz795mHz624vL/v8e1vP72W4z+7Jd3vXX/5x8Ml03nfw6/PttOpnfPGxWj7vFrP/k/XL9ZfJpt31cTCfL2836AHxYflnPV/231/Ovi8mnyXa+XE32312u7xY98Nu09qHNzeZ+s929+KD99sN0sljvlrvl4oAeLn79vH78erPY7knT47dvH7c/L+5m/V+azSfTyf3mYf+tzXq8h5kdbmFm3J5+t9wubg//aWwvyyuqpdQGNFaYjjJLFiT1lGo6QdZQpd5URjWNUANkjZTagNYkTZRZnCBpplTTCbIWPKrGHKjpt9CaqKZ7oj7s9sAvP+4Gbk3WAzS/LakxeACeJK1hLMXkwm/Y0Rsu9RuuQj2/4bN3jFeOGedjeDUdfY36vHIG3O2P8+V6NtrPU7L/Pozs71/RQw2efgtvYX05Yv1rbFXmzLA5NKV1NSxeRDlVB7gmq+2wFR1tswNas4ZOVGuq1CrUYqjjULykbOBQj6GJQwOGFg6NFOoERSUMFRSVMVRQVMFQriiHH0uOK8rhFeW5ohxeUZ4ryuEV5bmiHF5RXlAUXlFeUBReUUFQFF5RQVAUXlFBUBReUYEryuMVFbiiPF5RkSvK4xUVuaI8XlGRK8rjFRUFReEVFQVF4RWVBEXhFZUEReEVlQRF4RWVuKICXlGJKyrgiES2HIoDErOjX2HfdnoCDkk8Q2sYf5l30r3e7+caPODhTPzGI77x83f+vH5ull9mi9X+j26Xt7P7zWpxyjp4o10VlBXQuAmvk4pCGvcJVVJ8Xh1PgbnTR83xpqaT7eIfj4uH3ee/L1e7xfZhCCUelHAI3D2F/n6o/jWjyD0+4OtyW4WUzoxldMrEfnJk+3ldo3lFrmPItS5YUM2BfXulxShag1dM09WgSfSsScwzZtGxBhY2FtG |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0eNrsvU1vI0m2JfhXErGYFdVw+7j2UehZzDRmZvWAQT/0qpBIKBTMTKIUihhJkTlvGvXfh+6kSKOCRj/nOBlVBTzEQnIGdez4dbtmbvfzf374+Pht/fV58/T6y8cvX/724S//8/jJy4e//LW5HP9v8/Dlaffxy+a3p/vH8bOn+8/rD3/5cP/ysv788XHz9Nvd5/uH3zdP6zv34e+rD5unT+v/98Nf3N9XZ/7o8f5j8x3/959XH9ZPr5vXzXo3ynTxH788ffv8cf28BVm9/eHm6WX9/Lr9bPXh65eX7R98eRphtyDmw3+x1Yf/+PCXu+SH/2Jb+E+b5/XD7itlpPEO1UOo8Yjq3qM6fwY2HGBfPt8/Pt6tH7dff9483H398rieGWHkfQYyHpk+f3m6e/h9/fJ6DslOuZ5BMuiejZRkWrUP9nvAoR4AXTlPLM9AOD8LUeYgbBaizkGUWQg3rC6qxhlxv7u11YetsDdfR4Td3PnytJ09D5vnh2+b8bHv/veX/+fb/eN24O23nr48b2fah3NkHE0m3Y6Mp8nULplJEX5b3z/f/fn7ev1IMgksk+BvxCSSq0WrSqkzAyEld8Mp0KySuwTBOhY2kxJo1bgngQJRTSzVCsFmEtYP7I4xzErAY1sm+7A8tmd6FjaQGzwIG/WtuCtYdgcFqULK5emplSFYVhF8YQU7v2r5yq7J7VIYT9fk+2+vXz7fj1++e3nYrJ8e1ndf7x/+xq3Ngd7J25eUmzCit/N2sbwJI3pPb1+hbsKI3tvbVfAdo4cvX7+un+8e7j9O05qhEWka8RY0jKaRF9PYnub+3C4g41Hur2Flq+06bD+v/rp917HVdruffs/j58P0+/jj7Tvjj9V2ebGftyCb1/XnLezxJLoaX8u3r1h/+fDvr/fjYvbT/7a7qfXzy/Y//9j+mO7Ekq+xVss1Bl/T8aQ5jCJCT7Yvr1+2Mvr12/PT/cP65Eh7heNqiIfdzEfsYOlZ2IE8r74+3z+9fP3y/Hq3FfLrOXB/yvn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0eNrl3dtuXbmVqOFX2dC11SDHgYMMsN9i3zWCguxSlYXIkluHdKeDvPteslP2qnhRGuSfg+JCLuKS5THn5HmS3yT/fPb2+vHy493VzcPZ7/58dvXu9ub+7Hf/+eez+6ufby6un352c/Hh8ux3Zw/v7x7vHy7vzv7y5uzq5sfL/zn7Xf3L79+cXd48XD1cXX7+V5/+408/3Dx+eHv4zd/VN7/864unf3p79eP5u9vr68t3D7d3Z2/OPt7eH/7p7c3TVQ7hzv0//M3Znw5/qFb+ww/XOdzNw93t9Q9vL99f/PHq8G8Ov/ju6u7d49XDD/eXDz/8dHV9CHu49MPd4+Xh9+8u7x+vH86vbv54uJHbu0Oom8fr67+8+ebG5MuN/XS4s8M/uL+8e3q2b+9J/vaefry6O9z/p9+ociK0fgl9+T8fDzd0f/5wd3Fz//H27uH87eX1w4lr6K+vcSKofQn68+PN+cPj3d3lqUD1lzD1VBBPBXk+Rlt+upcfLrKZ8Vxe2InAfan4/fNK30iXPvtyT9pPJ14tpLzpmEStGxXk0y2+XEGqoDuepYOuVREdJ6PYUh2ZBHFQSaY50tZrybcZcqqW1CC3O8uOnr3dRBEfa91I+xoxvi2R/8heZaMu2jM3209do6JrtNQ1drrHb0OfrP2C+sdPaXQqqqGobRLVF9uUOBmlrbUpp4NsdJLf5sip6i+dVP9ZfgwSdJIdul69Vku+VnKJVAVWWWrNnmvM7B/YlulGPf06glLLFD21dDtzFNonpcNRw+ipvGvoGpa6Ruw0vpZ7N+momZyl/EBRbfLKUxYb39NR6lrjezqIbDS+qRpgStrJSX6YkaCz7FivXr5aPC09xn25ObAgLXmqplonl0g1ODZ2WkjNhHY2WM1dgw1WJXWNrcGqpAqks8Gqni6azgarMom6OljVk1EWB6ung+wMViXTXjoarM7yAw1WJ9nRykZblqpUDY1RU3WqCblE7il0+6W+/lNf6puhNqykEoONXWvqGl9r9tvH6z8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /c | |
| for i = 1, 3 do | |
| game.player.force.technologies["worker-robots-storage-" .. i].researched = true | |
| end | |
| for i = 1, 7 do | |
| game.player.force.technologies["worker-robots-speed-" .. i].researched = true | |
| end | |
| game.player.force.technologies["worker-robots-speed-7"].level = 10 | |
| local r=1000 | |
| game.player.force.chart(game.player.surface, {{x = -r, y = -r}, {x = r, y = r}}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use anyhow::Context; | |
| use std::error::Error; | |
| use std::fmt; | |
| #[derive(Debug)] | |
| struct FooError {} | |
| impl fmt::Display for FooError { | |
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | |
| write!(f, "foo error!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::io; | |
| use std::process::Command; | |
| use std::thread; | |
| pub fn waitpid(id: u32) -> io::Result<i32> { | |
| let mut status = 0i32; | |
| let ret = unsafe { libc::waitpid(id as i32, &mut status, 0) }; | |
| if ret != -1 { | |
| Ok(status) | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use blake3::{Hasher, OutputReader}; | |
| pub enum RatchetingHasher { | |
| Absorbing(Hasher), | |
| Squeezing(OutputReader), | |
| } | |
| use RatchetingHasher::{Absorbing, Squeezing}; | |
| impl RatchetingHasher { |
NewerOlder