~jonsterling/forester-discuss

8 3

Mysterious bug in latest forester

Details
Message ID
<87y11xtzbo.fsf@owenlynch.org>
DKIM signature
pass
Download raw message
Hello,

I'm trying out the latest forester 5.0 prerelease, and when I run it on
any of my forests (the Safeguarded AI, Topos, or LocalCharts forests) I
get an error:

Fatal error: exception Unhandled asai effect/exception; use Reporter.run
Raised at Stdlib__Effect.Deep.try_with.(fun) in file "effect.ml", line 101, characters 47-54
Called from Eio_unix__Thread_pool.run in file "lib_eio/unix/thread_pool.ml", line 108, characters 8-13
Re-raised at Eio_unix__Thread_pool.run in file "lib_eio/unix/thread_pool.ml", line 113, characters 4-39
Called from Eio_linux__Sched.run.(fun) in file "lib_eio_linux/sched.ml", line 498, characters 22-90
Re-raised at Eio_linux__Sched.run in file "lib_eio_linux/sched.ml", line 509, characters 22-57
Called from Eio_linux__Sched.with_eventfd in file "lib_eio_linux/sched.ml", line 536, characters 8-18
Re-raised at Eio_linux__Sched.with_eventfd in file "lib_eio_linux/sched.ml", line 541, characters 4-39
Called from Eio_linux__Sched.with_sched in file "lib_eio_linux/sched.ml", lines 570-572, characters 8-109
Re-raised at Eio_linux__Sched.with_sched in file "lib_eio_linux/sched.ml", line 583, characters 8-43
Called from Dune__exe__Main in file "bin/forester/main.ml", lines 295-297, characters 2-44

It's a quite opaque error because the only place the stack trace
references forester code is in the very first part! It seems to happen
somewhere after name resolution, because I get errors about stuff like

 → error[Reporter.Message.Resolution_error]
 ꭍ ○ when expanding tree at address `silviculture-0001`
 ■ ./trees/silviculture-0001.tree
 36 | \put\transclude/title{Changelog}
    ^ path transclude/title could not be resolved

right before, which of course is to be expected in forester 5.0.

The forester-notes.org forest builds fine, so I assume it's something
that has changed between forester 4 and forester 5 that my old forests
are not up to code with, and is triggering this error. Probably it's
important to make sure that whatever this is, it will at least give a
meaningful error message so that the old forests can be migrated!

I'm at a bit of a loss at how to proceed, and perhaps it's just that
forester 5.0 is in a state of flux, but perhaps you have some spider
sense about where this error is coming from?

-Owen
Details
Message ID
<D5EE60E8SVEN.WY5YWF46D8BX@gmail.com>
In-Reply-To
<87y11xtzbo.fsf@owenlynch.org> (view parent)
DKIM signature
pass
Download raw message
Well, title and taxon overrides are no longer supported, so does
removing all overrides resolve your issues?

https://www.forester-notes.org/jms-0126.xml

Best, Kento
Details
Message ID
<D5EE7KDXB6QF.11WLLQANS1R3F@gmail.com>
In-Reply-To
<87y11xtzbo.fsf@owenlynch.org> (view parent)
DKIM signature
pass
Download raw message
To clarify, it seems that you are aware of the deprecation, but I think
that there is some erroneous logic in the error reporting that does not
abort the computation, hence the confusing stack trace.
Details
Message ID
<CAETRDCmJZa2cT=ict4nLKEyqj77FzRM-NV-LO2QXWq2nc7wSpg@mail.gmail.com>
In-Reply-To
<D5EE7KDXB6QF.11WLLQANS1R3F@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Hi Jon and all,

For the issue raised by OP, it's indeed better to recognize the
deprecated syntax and prompt accordingly, instead of dropping the user
to a mysterious internal error.

I would also like to take this opportunity to voice out about wishing
to keep the ability to re-title (thus re-purpose) a note in different
contexts, which seems principally vital to me for a Zettelkasten notes
system. That said, I completely understand that it might be
unnecessarily complicated for supporting this in the coming hyper
media change, and I can embrace this change, but I still wish to seed
its return in the future.

The rationale behind considering it vital to Zettelkasten-style
noting, is that I would like to take a note on a whim without
considering how to title it best for different contexts, so the mental
barrier to start a note will be minimal, I can still do this in
forester 5.x, but mental burden is back when I need to transclude it
in different context, I'll have difficulty to change the title to work
best for all cases: standalone and transcluded in different context,
so this might lead to hindering the note reuse.

My use cases for re-purposing notes are:

1. remove the title when the note is transcluded, because it now
becomes a natural paragraph of the new context, without adding a new
section etc.
2. the title of the note being transcluded is fine for a standalone
note, but needs to reword to fit in the context: it might be removing
some redundant words that would be clear in the context, but it's
still needed for the standalone note for self-containedness and better
search; or it might be to add some additional wording required for the
new context;

In light of these use cases, taking the implementation complications
into account, is it possible to implement a title-less transclusion,
so I can still repurpose notes?

Regards,

Utensil Song
Details
Message ID
<D5EW6X7MEG4N.EMTZLEWQ6AEV@gmail.com>
In-Reply-To
<CAETRDCmJZa2cT=ict4nLKEyqj77FzRM-NV-LO2QXWq2nc7wSpg@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
Hi all,

so my suspicion was wrong, and I need to investigate this more, but I
*can* reproduce it.'

> For the issue raised by OP, it's indeed better to recognize the
> deprecated syntax and prompt accordingly, instead of dropping the user
> to a mysterious internal error.

Of course, this behavior is unintended, but it seems that this does not
have to do with the removal of transclusion overrides, as I see the same
error on something like this:

```
 → error[Reporter.Message.Resolution_error]
 ꭍ ○ when expanding tree at address `jms-00EY`
 ■ ./trees/jms-00EY.tree
 10 | \put\foo/bar{}
    ^ path foo/bar could not be resolved

Fatal error: exception Unhandled asai effect/exception; use Reporter.run
Raised at Stdlib__Effect.Deep.try_with.(fun) in file "effect.ml", line 101, characters 47-54
Called from Eio_unix__Thread_pool.run in file "lib_eio/unix/thread_pool.ml", line 108, characters 8-13
Re-raised at Eio_unix__Thread_pool.run in file "lib_eio/unix/thread_pool.ml", line 113, characters 4-39
Called from Eio_linux__Sched.run.(fun) in file "lib_eio_linux/sched.ml", line 498, characters 22-90
Re-raised at Eio_linux__Sched.run in file "lib_eio_linux/sched.ml", line 509, characters 22-57
Called from Eio_linux__Sched.with_eventfd in file "lib_eio_linux/sched.ml", line 536, characters 8-18
Re-raised at Eio_linux__Sched.with_eventfd in file "lib_eio_linux/sched.ml", line 541, characters 4-39
Called from Eio_linux__Sched.with_sched in file "lib_eio_linux/sched.ml", lines 570-572, characters 8-109
Re-raised at Eio_linux__Sched.with_sched in file "lib_eio_linux/sched.ml", line 583, characters 8-43
Called from Forester_prelude__Fun_util.let@ in file "lib/prelude/Fun_util.ml" (inlined), line 7, characters 13-19
Called from Dune__exe__Main in file "bin/forester/main.ml", lines 293-295, characters 2-44
```
Details
Message ID
<D5EWKOB4X7JY.6F1L4CMGCAZ7@gmail.com>
In-Reply-To
<D5EW6X7MEG4N.EMTZLEWQ6AEV@gmail.com> (view parent)
DKIM signature
pass
Download raw message
I think it has to do with the use of fibers in `Map_reduce.ml`: I
suspect that what is happening inside here is opaque to the outer
reporter:

```
module Make (I: Input) = struct
  let reduce ?(max_fibers = 20) ?(init = I.nil) ~env inputs =
    List.fold_left I.plus init @@
      Eio.Fiber.List.map ~max_fibers (I.eval env) inputs
end
```
Details
Message ID
<21A5B277-4FC9-41ED-A13E-1ACDD7E5FC6E@fastmail.fm>
In-Reply-To
<D5EWKOB4X7JY.6F1L4CMGCAZ7@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Feel free to rip out that code if it helps, I was just playing around. 

> On 6 Nov 2024, at 7:04 am, Kento Okura <kentookura@gmail.com> wrote:
> 
> I think it has to do with the use of fibers in `Map_reduce.ml`: I
> suspect that what is happening inside here is opaque to the outer
> reporter:
> 
> ```
> module Make (I: Input) = struct
>  let reduce ?(max_fibers = 20) ?(init = I.nil) ~env inputs =
>    List.fold_left I.plus init @@
>      Eio.Fiber.List.map ~max_fibers (I.eval env) inputs
> end
> ```
Details
Message ID
<D5EY6G4GRMBN.1WG37SI9LLLQO@gmail.com>
In-Reply-To
<21A5B277-4FC9-41ED-A13E-1ACDD7E5FC6E@fastmail.fm> (view parent)
DKIM signature
pass
Download raw message
I reverted that commit, but that did not fix the issue... Will keep at
it.
Details
Message ID
<D5EYCN5T1U12.3K5MXN92JQQ4O@gmail.com>
In-Reply-To
<21A5B277-4FC9-41ED-A13E-1ACDD7E5FC6E@fastmail.fm> (view parent)
DKIM signature
pass
Download raw message
My bad, I was not using my development version of forester when testing,
this should be fixed now. Owen, can you confirm tihs issue no longer
occurs on the latest commit?

Best, Kento
Reply to thread Export thread (mbox)