Skip to content
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

Closed
wants to merge 53 commits into from

Commits on Apr 17, 2024

  1. struct DisjointMutBounds: Store Location::caller.

    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.
    kkysen committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    0e4fb3c View commit details
    Browse the repository at this point in the history
  2. trait DisjointMutIndex: Improve error messages to match std's and…

    … add `#[track_caller]`s when `debug_assertions`.
    kkysen committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    428787c View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2024

  1. struct DisjointMut: Store Location::caller() and improve out of b…

    …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`).
    kkysen authored Apr 18, 2024
    Configuration menu
    Copy the full SHA
    99fc2e4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    82570be View commit details
    Browse the repository at this point in the history
  3. struct DisjointMut: Fix missing initializations of DisjointMut fi…

    …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.
    kkysen authored Apr 18, 2024
    Configuration menu
    Copy the full SHA
    00df89d View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2024

  1. Configuration menu
    Copy the full SHA
    8097a91 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c365d13 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    57bdd9e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9792f54 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5a5dfc5 View commit details
    Browse the repository at this point in the history
  6. fn Rav1dRefmvsDSPContext::load_tmvs: Inline `fn RefMvsFrame::as_mut…

    …_dav1d`, as this is the only callsite and we'll need to store stuff on the stack.
    kkysen committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    75d0d06 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0ad9f33 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    dcdb372 View commit details
    Browse the repository at this point in the history
  9. struct Rav1dRefmvsDSPContext: Make fn ptr fields private now that…

    … there are safer wrapper methods.
    kkysen committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    6b4ef97 View commit details
    Browse the repository at this point in the history
  10. struct RefMvsFrame::{rp,rp_ref}: Remove raw ptr fields and pass thr…

    …ough the callstack.
    kkysen committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    d3f252e View commit details
    Browse the repository at this point in the history
  11. fn save_tmvs_c: Make stride a usize (it already is on the other…

    … side of the `fn` ptr boundary).
    kkysen committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    3eb384e View commit details
    Browse the repository at this point in the history
  12. struct Rav1dFrameData::{mvs,ref_mvs}: Arcify with Option<Disjoi…

    …ntMutArcSlice<refmvs_temporal_block>>`s.
    kkysen committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    6420e5a View commit details
    Browse the repository at this point in the history
  13. struct Rav1dContext::refmvs_pool: Remove (for now) now-unused `refm…

    …vs_pool` now that `mvs`s have been `Arc`ified.
    kkysen committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    baa4212 View commit details
    Browse the repository at this point in the history
  14. struct Rav1dContext::cdf_pool: Remove (for now) now-unused `cdf_poo…

    …l` now that `cdf`s have been `Arc`ified.
    kkysen committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    990ff36 View commit details
    Browse the repository at this point in the history
  15. fn get_prev_frame segid: Fix overslicing (#979)

    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.
    kkysen authored Apr 19, 2024
    Configuration menu
    Copy the full SHA
    2030345 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    4501b38 View commit details
    Browse the repository at this point in the history
  17. struct Rav1dRefmvsDSPContext: Add wrapper methods (#976)

    `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.
    kkysen authored Apr 19, 2024
    Configuration menu
    Copy the full SHA
    d862eea View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    9ee877e View commit details
    Browse the repository at this point in the history
  19. struct Rav1dFrameData::{mvs,ref_mvs}: Arcify with `Option<Disjoin…

    …tMutArcSlice<refmvs_temporal_block>>`s (#984)
    
    * Fixes `{,ref_}mvs{,_ref}` fields of #713.
    * Fixes `refmvs{,_pool}` fields of #641.
    kkysen authored Apr 19, 2024
    Configuration menu
    Copy the full SHA
    d5c1619 View commit details
    Browse the repository at this point in the history
  20. struct Rav1dContext::cdf_pool: Remove now-unused cdf_pool (#985)

    This was already `Arc`ified in a previous PR, so this removes the now
    unused pool.
    kkysen authored Apr 19, 2024
    Configuration menu
    Copy the full SHA
    ebfe7ba View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    aa35bf9 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    97a381d View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    258e619 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    5a08062 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    baaa8a9 View commit details
    Browse the repository at this point in the history
  26. fn rav1d_get_cpu_flags: Remove #[cfg(feature = "asm")]; it will j…

    …ust mostly nothing if asm is disabled.
    kkysen committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    34a993e View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    3c168aa View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    213fcaf View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    6b96706 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    4a9441c View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    723e3ee View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    11a02db View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    ef6ff68 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    263bb73 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    bd3ef93 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    f06c06b View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    e263531 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    b45e601 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    56f11c8 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    96b1e25 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    dd2a181 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    7667ae3 View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    cb534ed View commit details
    Browse the repository at this point in the history
  44. fn Rav1dDSPContext::get: Lazily initialize with a OnceLock, stori…

    …ng `&'static` refs in `Rav1dContext`.
    kkysen committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    6dc1735 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    15e995a View commit details
    Browse the repository at this point in the history
  46. fn Rav1dDSPContext::get: Lazily initialize with OnceLock and stor…

    …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'`.
    kkysen authored Apr 19, 2024
    Configuration menu
    Copy the full SHA
    3ad56bb View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    b8b83d5 View commit details
    Browse the repository at this point in the history
  48. Fix cdef_line_buf strides

    rinon committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    217cd21 View commit details
    Browse the repository at this point in the history