GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Rich Felker (dalias@hachyderm.io)'s status on Sunday, 29-Jun-2025 12:56:34 JST Rich Felker Rich Felker

    Just designed and tested an algorithm to build a reverse-iterator on top of an iterator that can only run in forwards direction (part of the #musl collation project) and it seems to be good!

    63 underlying forward-iterate steps to perform 21 reverse-iterate steps in simple test case.

    In conversation about a year ago from hachyderm.io permalink
    • Embed this notice
      Rich Felker (dalias@hachyderm.io)'s status on Sunday, 29-Jun-2025 13:01:34 JST Rich Felker Rich Felker
      in reply to

      5932 forward iterate steps to do 1000 reverse iterate steps.

      In conversation about a year ago permalink
    • Embed this notice
      Rich Felker (dalias@hachyderm.io)'s status on Sunday, 29-Jun-2025 13:04:08 JST Rich Felker Rich Felker
      in reply to

      Expected to be O(n log n), looks like empirically it's about 2/3 n log n.

      In conversation about a year ago permalink
    • Embed this notice
      Rich Felker (dalias@hachyderm.io)'s status on Sunday, 29-Jun-2025 22:12:51 JST Rich Felker Rich Felker
      in reply to
      • LR
      • Paul Khuong

      @lritter @pkhuong Yes it needs logarithmic space but that's constant space for all practical purposes because log(n) is bounded by 64.

      In conversation about a year ago permalink
    • Embed this notice
      LR (lritter@mastodon.gamedev.place)'s status on Sunday, 29-Jun-2025 22:12:52 JST LR LR
      in reply to
      • Paul Khuong

      @pkhuong @dalias yeah. so, an ad-hoc search tree. it has fragments that appear in in-place sorting algorithms.

      then it is all the more important to mention the time-for-space trade-off, since that's the whole point.

      In conversation about a year ago permalink
    • Embed this notice
      Paul Khuong (pkhuong@discuss.systems)'s status on Sunday, 29-Jun-2025 22:12:53 JST Paul Khuong Paul Khuong
      in reply to
      • LR

      @lritter @dalias you keep log n copies of earlier iterators (and always keep a copy of the initial iterator). The copies are more dense when you're closer to the current location (and fully dense just before)

      In conversation about a year ago permalink
    • Embed this notice
      LR (lritter@mastodon.gamedev.place)'s status on Sunday, 29-Jun-2025 22:12:54 JST LR LR
      in reply to

      @dalias what.. how is that even logically possible. it needs n iters to reach the beginning of the iteration range. then m iters to go through the range, buffer all results. then another m to go through the buffer in reverse (the actual reverse iteration). space needed is also m.

      do you know of a different way to do this? b/c it doesn't seem like 1-step-iterators give us much freedom here.

      or do you build an ad-hoc search tree? then the space needed would be log m and m log m makes more sense

      In conversation about a year ago permalink
    • Embed this notice
      Rich Felker (dalias@hachyderm.io)'s status on Monday, 30-Jun-2025 00:21:19 JST Rich Felker Rich Felker
      in reply to
      • LR
      • Paul Khuong

      @pkhuong @lritter Yep, this is exactly how it works. In fact initially it only keeps one copy, of the initial iterator; it then pushes another one each time it reaches the halfway point between the last one it dropped and the (known-index) end position, and it pops them as they become irrelevant by being for an already-traversed position.

      In conversation about a year ago permalink
    • Embed this notice
      Rich Felker (dalias@hachyderm.io)'s status on Monday, 30-Jun-2025 00:25:29 JST Rich Felker Rich Felker
      in reply to
      • LR
      • Paul Khuong

      @pkhuong @lritter Lovely aside: this can also be applied to video (if your decoded objects can be copied, which may be a bad assumption for typical existing implementations) and solves problems I wanted to solve decades ago for being able to transform video efficiently in random-access-like patterns without having to transcode to a keyframe-dense form.

      In conversation about a year ago permalink
    • Embed this notice
      Rich Felker (dalias@hachyderm.io)'s status on Monday, 30-Jun-2025 00:34:48 JST Rich Felker Rich Felker
      in reply to
      • LR
      • Paul Khuong

      @lritter @pkhuong For your case where there's no a priori finite end time, I think you need a slightly different strategy that's not a pure stack. You need to be able to decimate and repack the waypoints to maintain a logarithmic bound on them.

      In conversation about a year ago permalink
    • Embed this notice
      LR (lritter@mastodon.gamedev.place)'s status on Monday, 30-Jun-2025 00:34:49 JST LR LR
      in reply to
      • Paul Khuong

      @dalias @pkhuong i'm working on fixpoint-iterative primitives lately (as an alternative to structured control flow) that are strictly forward-facing but trivially copyable, and this would be an ideal solution to support time-reversed debugging.

      In conversation about a year ago permalink
    • Embed this notice
      Rich Felker (dalias@hachyderm.io)'s status on Monday, 30-Jun-2025 00:47:43 JST Rich Felker Rich Felker
      in reply to
      • LR
      • Paul Khuong

      @pkhuong @lritter Yes that seems like a valid strategy.

      In conversation about a year ago permalink
    • Embed this notice
      Paul Khuong (pkhuong@discuss.systems)'s status on Monday, 30-Jun-2025 00:47:44 JST Paul Khuong Paul Khuong
      in reply to
      • LR

      @dalias @lritter pretty sure you can bucket iterators by ctz of their index, and keep the highest indexed iterator in each bucket.

      In conversation about a year ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.