-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create safe slices from cdef_line_buf
#981
Conversation
When backtraces are disabled (due to their large performance overhead), we can still capture the `Location::caller()`, which is quite cheap. This is very useful for rare panics in CI, which can be hard to reproduce.
… add `#[track_caller]`s when `debug_assertions`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails due to out of bounds slice access in the third backup_lpf call (https://github.com/memorysafety/rav1d/pull/981/files#diff-e9e188b522fe10286c7075c8068b07949fff51301681598c10c42927aa884061R339). I think this length must be wrong. @fbossen, can you look at this? Looks like you added the slice originally and I don't really understand that PR (#728).
…ounds error messages (#980) When backtraces are disabled (due to their large performance overhead), we can still capture the `Location::caller()`, which is quite cheap. This is very useful for rare panics in CI, which can be hard to reproduce. This also makes the out-of-bounds error messages more informative (they say which thing exactly is out of bounds and what the bound was, like `std`).
…elds (#978) I found these by running the argon tests in debug mode (not just `debug_assertions`), as these `libstd` assertions are only run in actual debug mode.
…_dav1d`, as this is the only callsite and we'll need to store stuff on the stack.
… there are safer wrapper methods.
…ough the callstack.
… side of the `fn` ptr boundary).
…ntMutArcSlice<refmvs_temporal_block>>`s.
…vs_pool` now that `mvs`s have been `Arc`ified.
…l` now that `cdf`s have been `Arc`ified.
This fixes a bug from #971 where I was overslicing. It wasn't caught by the normal tests, only the argon tests that only ran on `main` once I merged.
`fn splat_mv` is already a method, and `fn rav1d_refmvs_save_tmvs` was already like a method, but as a free `fn`. So this just makes them all methods on `Rav1dRefmvsDspContext`, which helps things for `fn load_tmvs` as I make it and the `mvs` fields safe.
…ough the callstack (#983)
This was already `Arc`ified in a previous PR, so this removes the now unused pool.
…ust mostly nothing if asm is disabled.
…ng `&'static` refs in `Rav1dContext`.
…e `&'static`s (#986) * Fixes `dsp` field of #713. * Fixes all `fn *dsp_init`s of #862. * Improves DSP initialization code size of #809. This * Makes all `fn *dsp_init*`s safe. * Changes all `fn *dsp_init*`s into `fn *DSPContext::new`s that directly initialize the type without `unsafe`ly zero initializing it first. This is done by directly initializing in `fn default`, which is for the fallback `fn`s, and then updating the `fn` ptrs in the `fn init_{x86,arm}`s. These `fn`s are also all `const` now, as that was trivial. * Adds `wrap_fn_ptr!` and `enum_map!`s to the array fields of `Rav1dMCDSPContext`, since I needed a default value to initialize the arrays directly if I want it the indices to be named (rather than a normal array, whose order is easy to mix up). `wrap_fn_ptr!` provides that default value, which is then optimized out. * Replaces the `Rav1dContext::dsp` array, which is manually lazily initialized, with `fn Rav1dDSPContext::get`, which uses `OnceLock` for lazy initialization. * Makes the `Rav1dFrameData::dsp` raw ptr into a `&'static` now that we lazily initialize it with `OnceLock`. This also dramatically reduces the code size of DSP initialization (in KiB): | Target | Before | After | | ------------------------------- | ------ | ----- | | `x86_64-unknown-linux-gnu` | 192.5 | 95.6 | | `i686-unknown-linux-gnu` | 106.5 | 39.6 | | `aarch64-unknown-linux-gnu` | 88.2 | 15.3 | | `armv7-unknown-linux-gnueabihf` | 103.8 | 17.0 | This is measured before using `cargo bloat --filter 'dsp_init'` and after using `cargo bloat --filter 'DSPContext::new'`.
|
No description provided.