home.social

#unpaper — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #unpaper, aggregated by home.social.

fetched live
  1. Okay a little bit of #unpaper ghosts for tonight.

    I'm nearly at the end of completing the work @federicomena started: moving all the options into an Options structure instead of using a bunch of separate globals (which I already turned into locals to main() at least.)

    This would unblock, among others, the option of processing each input file in parallel instead of doing them one by one.

    I was hoping to hide some of those locals by defining them in a block within the parser… but tests fail.

  2. Okay a little bit of #unpaper ghosts for tonight.

    I'm nearly at the end of completing the work @federicomena started: moving all the options into an Options structure instead of using a bunch of separate globals (which I already turned into locals to main() at least.)

    This would unblock, among others, the option of processing each input file in parallel instead of doing them one by one.

    I was hoping to hide some of those locals by defining them in a block within the parser… but tests fail.

  3. Okay a little bit of #unpaper ghosts for tonight.

    I'm nearly at the end of completing the work @federicomena started: moving all the options into an Options structure instead of using a bunch of separate globals (which I already turned into locals to main() at least.)

    This would unblock, among others, the option of processing each input file in parallel instead of doing them one by one.

    I was hoping to hide some of those locals by defining them in a block within the parser… but tests fail.

  4. Okay a little bit of #unpaper ghosts for tonight.

    I'm nearly at the end of completing the work @federicomena started: moving all the options into an Options structure instead of using a bunch of separate globals (which I already turned into locals to main() at least.)

    This would unblock, among others, the option of processing each input file in parallel instead of doing them one by one.

    I was hoping to hide some of those locals by defining them in a block within the parser… but tests fail.

  5. Okay a little bit of #unpaper ghosts for tonight.

    I'm nearly at the end of completing the work @federicomena started: moving all the options into an Options structure instead of using a bunch of separate globals (which I already turned into locals to main() at least.)

    This would unblock, among others, the option of processing each input file in parallel instead of doing them one by one.

    I was hoping to hide some of those locals by defining them in a block within the parser… but tests fail.

  6. one last note for the day from my #unpaper refactoring work: what is even the point of doing bitwise operations in C to try to contain up to four edges (left, top, right, bottom) into an `int` variable?

    `struct Edges { bool left; bool top; bool right; bool bottom; }` is literally the same size, the difference being instead of keeping the data in the lower four bits, it puts it one byte per edge!

  7. one last note for the day from my #unpaper refactoring work: what is even the point of doing bitwise operations in C to try to contain up to four edges (left, top, right, bottom) into an `int` variable?

    `struct Edges { bool left; bool top; bool right; bool bottom; }` is literally the same size, the difference being instead of keeping the data in the lower four bits, it puts it one byte per edge!

  8. one last note for the day from my #unpaper refactoring work: what is even the point of doing bitwise operations in C to try to contain up to four edges (left, top, right, bottom) into an `int` variable?

    `struct Edges { bool left; bool top; bool right; bool bottom; }` is literally the same size, the difference being instead of keeping the data in the lower four bits, it puts it one byte per edge!

  9. one last note for the day from my #unpaper refactoring work: what is even the point of doing bitwise operations in C to try to contain up to four edges (left, top, right, bottom) into an `int` variable?

    `struct Edges { bool left; bool top; bool right; bool bottom; }` is literally the same size, the difference being instead of keeping the data in the lower four bits, it puts it one byte per edge!

  10. one last note for the day from my #unpaper refactoring work: what is even the point of doing bitwise operations in C to try to contain up to four edges (left, top, right, bottom) into an `int` variable?

    `struct Edges { bool left; bool top; bool right; bool bottom; }` is literally the same size, the difference being instead of keeping the data in the lower four bits, it puts it one byte per edge!

  11. Yesterday's maintenance work on #unpaper is something that to me clearly shows the point I was making about the opportunities arising in treating *specific* #LLMs as Computer-Aided Software Engineering (CASE) tools, so I thought I would post a quick thread here, since I don't think I'll manage to post it on the blog any time soon.

    Full disclosure before I start: I work for Meta, which clearly has been betting a lot on AI — but this is my personal point of view, and I don't work on AI projects.

  12. Yesterday's maintenance work on #unpaper is something that to me clearly shows the point I was making about the opportunities arising in treating *specific* #LLMs as Computer-Aided Software Engineering (CASE) tools, so I thought I would post a quick thread here, since I don't think I'll manage to post it on the blog any time soon.

    Full disclosure before I start: I work for Meta, which clearly has been betting a lot on AI — but this is my personal point of view, and I don't work on AI projects.

  13. Yesterday's maintenance work on #unpaper is something that to me clearly shows the point I was making about the opportunities arising in treating *specific* #LLMs as Computer-Aided Software Engineering (CASE) tools, so I thought I would post a quick thread here, since I don't think I'll manage to post it on the blog any time soon.

    Full disclosure before I start: I work for Meta, which clearly has been betting a lot on AI — but this is my personal point of view, and I don't work on AI projects.

  14. Yesterday's maintenance work on #unpaper is something that to me clearly shows the point I was making about the opportunities arising in treating *specific* #LLMs as Computer-Aided Software Engineering (CASE) tools, so I thought I would post a quick thread here, since I don't think I'll manage to post it on the blog any time soon.

    Full disclosure before I start: I work for Meta, which clearly has been betting a lot on AI — but this is my personal point of view, and I don't work on AI projects.

  15. Yesterday's maintenance work on #unpaper is something that to me clearly shows the point I was making about the opportunities arising in treating *specific* #LLMs as Computer-Aided Software Engineering (CASE) tools, so I thought I would post a quick thread here, since I don't think I'll manage to post it on the blog any time soon.

    Full disclosure before I start: I work for Meta, which clearly has been betting a lot on AI — but this is my personal point of view, and I don't work on AI projects.

  16. Only a minor #unpaper task today because I'm still recovering from a very annoying flu, but I decided to re-do the parsing of physical dimensions so that it stops being quite random depending on the order of passing -dpi (which is the wrong name anyway) and the sizes themselves.

  17. Only a minor #unpaper task today because I'm still recovering from a very annoying flu, but I decided to re-do the parsing of physical dimensions so that it stops being quite random depending on the order of passing -dpi (which is the wrong name anyway) and the sizes themselves.

  18. Only a minor #unpaper task today because I'm still recovering from a very annoying flu, but I decided to re-do the parsing of physical dimensions so that it stops being quite random depending on the order of passing -dpi (which is the wrong name anyway) and the sizes themselves.

  19. Only a minor #unpaper task today because I'm still recovering from a very annoying flu, but I decided to re-do the parsing of physical dimensions so that it stops being quite random depending on the order of passing -dpi (which is the wrong name anyway) and the sizes themselves.

  20. Only a minor #unpaper task today because I'm still recovering from a very annoying flu, but I decided to re-do the parsing of physical dimensions so that it stops being quite random depending on the order of passing -dpi (which is the wrong name anyway) and the sizes themselves.

  21. Okay I guess by this point I need to put numbers together and make a blog post — on a different system (native rather than WSL), a clang -O2 build running the same #unpaper pipeline takes 6.1s.

    The same revision but built "ricer" (-O3 -march=native -ftree-vectorize) takes 3.5s! But the text size of the binary is quite increased: 75KB vs 91KB.

    Unfortunately codiff (at least the OpenSUSE version) doesn't like those DWARVES :(

  22. Okay I guess by this point I need to put numbers together and make a blog post — on a different system (native rather than WSL), a clang -O2 build running the same #unpaper pipeline takes 6.1s.

    The same revision but built "ricer" (-O3 -march=native -ftree-vectorize) takes 3.5s! But the text size of the binary is quite increased: 75KB vs 91KB.

    Unfortunately codiff (at least the OpenSUSE version) doesn't like those DWARVES :(

  23. Okay I guess by this point I need to put numbers together and make a blog post — on a different system (native rather than WSL), a clang -O2 build running the same #unpaper pipeline takes 6.1s.

    The same revision but built "ricer" (-O3 -march=native -ftree-vectorize) takes 3.5s! But the text size of the binary is quite increased: 75KB vs 91KB.

    Unfortunately codiff (at least the OpenSUSE version) doesn't like those DWARVES :(

  24. Okay I guess by this point I need to put numbers together and make a blog post — on a different system (native rather than WSL), a clang -O2 build running the same #unpaper pipeline takes 6.1s.

    The same revision but built "ricer" (-O3 -march=native -ftree-vectorize) takes 3.5s! But the text size of the binary is quite increased: 75KB vs 91KB.

    Unfortunately codiff (at least the OpenSUSE version) doesn't like those DWARVES :(

  25. Okay I guess by this point I need to put numbers together and make a blog post — on a different system (native rather than WSL), a clang -O2 build running the same #unpaper pipeline takes 6.1s.

    The same revision but built "ricer" (-O3 -march=native -ftree-vectorize) takes 3.5s! But the text size of the binary is quite increased: 75KB vs 91KB.

    Unfortunately codiff (at least the OpenSUSE version) doesn't like those DWARVES :(

  26. Okay either there is something wrong in the code, or wow does GCC not keep up.

    (Editing for clarity)

    Of the two #unpaper binaries, one built with clang, the other with gcc, both with -O2 and LTO, the first take 16s to run, the latter 33s!

    Maybe it's the LTO that makes a difference? If that is the case it's well possible that I could see a significant performance regression with the refactoring, with GCC — the code is now split across multiple units rather than in a single one.

  27. Okay either there is something wrong in the code, or wow does GCC not keep up.

    (Editing for clarity)

    Of the two #unpaper binaries, one built with clang, the other with gcc, both with -O2 and LTO, the first take 16s to run, the latter 33s!

    Maybe it's the LTO that makes a difference? If that is the case it's well possible that I could see a significant performance regression with the refactoring, with GCC — the code is now split across multiple units rather than in a single one.

  28. Okay either there is something wrong in the code, or wow does GCC not keep up.

    (Editing for clarity)

    Of the two #unpaper binaries, one built with clang, the other with gcc, both with -O2 and LTO, the first take 16s to run, the latter 33s!

    Maybe it's the LTO that makes a difference? If that is the case it's well possible that I could see a significant performance regression with the refactoring, with GCC — the code is now split across multiple units rather than in a single one.

  29. Okay either there is something wrong in the code, or wow does GCC not keep up.

    (Editing for clarity)

    Of the two #unpaper binaries, one built with clang, the other with gcc, both with -O2 and LTO, the first take 16s to run, the latter 33s!

    Maybe it's the LTO that makes a difference? If that is the case it's well possible that I could see a significant performance regression with the refactoring, with GCC — the code is now split across multiple units rather than in a single one.

  30. Okay either there is something wrong in the code, or wow does GCC not keep up.

    (Editing for clarity)

    Of the two #unpaper binaries, one built with clang, the other with gcc, both with -O2 and LTO, the first take 16s to run, the latter 33s!

    Maybe it's the LTO that makes a difference? If that is the case it's well possible that I could see a significant performance regression with the refactoring, with GCC — the code is now split across multiple units rather than in a single one.

  31. Talk about the non-obviousness of optimizations! I thought that, since most of the time in #unpaper was spent on the set/get pixel, and these both had huge switch/case blocks, getting rid of those in favour of using function pointers could have helped.

    Nope! Regressed by over two seconds on a six seconds run. That's *quite worse.* I guess I'll keep optimizing for readability and trust the compiler.

  32. Talk about the non-obviousness of optimizations! I thought that, since most of the time in #unpaper was spent on the set/get pixel, and these both had huge switch/case blocks, getting rid of those in favour of using function pointers could have helped.

    Nope! Regressed by over two seconds on a six seconds run. That's *quite worse.* I guess I'll keep optimizing for readability and trust the compiler.

  33. Talk about the non-obviousness of optimizations! I thought that, since most of the time in #unpaper was spent on the set/get pixel, and these both had huge switch/case blocks, getting rid of those in favour of using function pointers could have helped.

    Nope! Regressed by over two seconds on a six seconds run. That's *quite worse.* I guess I'll keep optimizing for readability and trust the compiler.

  34. Talk about the non-obviousness of optimizations! I thought that, since most of the time in #unpaper was spent on the set/get pixel, and these both had huge switch/case blocks, getting rid of those in favour of using function pointers could have helped.

    Nope! Regressed by over two seconds on a six seconds run. That's *quite worse.* I guess I'll keep optimizing for readability and trust the compiler.

  35. Talk about the non-obviousness of optimizations! I thought that, since most of the time in #unpaper was spent on the set/get pixel, and these both had huge switch/case blocks, getting rid of those in favour of using function pointers could have helped.

    Nope! Regressed by over two seconds on a six seconds run. That's *quite worse.* I guess I'll keep optimizing for readability and trust the compiler.

  36. Okay #unpaper poll time: I'm going to definitely change the way it configures masks: there's both auto-masking and user-inserted masks. Right now it allocates 100 items for each of those, with a running count. The order *shouldn't* matter, they are only added to during option parsing and iterated over a few times.

    I'm going to change these with a structure that holds a count as well as the actual masks, either with a flexible array or with a linked list.

    Which one do you think make more sense?

  37. Okay #unpaper poll time: I'm going to definitely change the way it configures masks: there's both auto-masking and user-inserted masks. Right now it allocates 100 items for each of those, with a running count. The order *shouldn't* matter, they are only added to during option parsing and iterated over a few times.

    I'm going to change these with a structure that holds a count as well as the actual masks, either with a flexible array or with a linked list.

    Which one do you think make more sense?

  38. Okay #unpaper poll time: I'm going to definitely change the way it configures masks: there's both auto-masking and user-inserted masks. Right now it allocates 100 items for each of those, with a running count. The order *shouldn't* matter, they are only added to during option parsing and iterated over a few times.

    I'm going to change these with a structure that holds a count as well as the actual masks, either with a flexible array or with a linked list.

    Which one do you think make more sense?

  39. Okay #unpaper poll time: I'm going to definitely change the way it configures masks: there's both auto-masking and user-inserted masks. Right now it allocates 100 items for each of those, with a running count. The order *shouldn't* matter, they are only added to during option parsing and iterated over a few times.

    I'm going to change these with a structure that holds a count as well as the actual masks, either with a flexible array or with a linked list.

    Which one do you think make more sense?

  40. Okay #unpaper poll time: I'm going to definitely change the way it configures masks: there's both auto-masking and user-inserted masks. Right now it allocates 100 items for each of those, with a running count. The order *shouldn't* matter, they are only added to during option parsing and iterated over a few times.

    I'm going to change these with a structure that holds a count as well as the actual masks, either with a flexible array or with a linked list.

    Which one do you think make more sense?

  41. Okay more minor analysis of where #unpaper 7.1 is heading: the size of the ELF file shows that there is more *code* (>25KiB) but there's a *lot less* bss (108 bytes vs 10992 before)

    That's because all of the global variables are now on the stack, I bet. The stack for `main()` is probably annoyingly high because there's still the whole set of (multiple) 100-rectangles array.

    One rectangle is supposedly 16 bytes, so that's probably accounting for most of those 10KiB less bss.

  42. Okay more minor analysis of where #unpaper 7.1 is heading: the size of the ELF file shows that there is more *code* (>25KiB) but there's a *lot less* bss (108 bytes vs 10992 before)

    That's because all of the global variables are now on the stack, I bet. The stack for `main()` is probably annoyingly high because there's still the whole set of (multiple) 100-rectangles array.

    One rectangle is supposedly 16 bytes, so that's probably accounting for most of those 10KiB less bss.

  43. Okay more minor analysis of where #unpaper 7.1 is heading: the size of the ELF file shows that there is more *code* (>25KiB) but there's a *lot less* bss (108 bytes vs 10992 before)

    That's because all of the global variables are now on the stack, I bet. The stack for `main()` is probably annoyingly high because there's still the whole set of (multiple) 100-rectangles array.

    One rectangle is supposedly 16 bytes, so that's probably accounting for most of those 10KiB less bss.

  44. Okay more minor analysis of where #unpaper 7.1 is heading: the size of the ELF file shows that there is more *code* (>25KiB) but there's a *lot less* bss (108 bytes vs 10992 before)

    That's because all of the global variables are now on the stack, I bet. The stack for `main()` is probably annoyingly high because there's still the whole set of (multiple) 100-rectangles array.

    One rectangle is supposedly 16 bytes, so that's probably accounting for most of those 10KiB less bss.

  45. Okay more minor analysis of where #unpaper 7.1 is heading: the size of the ELF file shows that there is more *code* (>25KiB) but there's a *lot less* bss (108 bytes vs 10992 before)

    That's because all of the global variables are now on the stack, I bet. The stack for `main()` is probably annoyingly high because there's still the whole set of (multiple) 100-rectangles array.

    One rectangle is supposedly 16 bytes, so that's probably accounting for most of those 10KiB less bss.

  46. Annoying I'm still not feeling great, so I'm now going to sleep it off a bit more. #unpaper 7.1 is getting closer, all of the global variables are gone, but now I'm paring down the number of arguments passed around by keeping the image-related state together.

    What am I looking for next? Well, it would be nice if I could just point people at a COPR repository or a PPA to get the binary. Is anyone willing to help with that?

    (I also keep getting requests for Windows builds, I have no clue on that

  47. Annoying I'm still not feeling great, so I'm now going to sleep it off a bit more. #unpaper 7.1 is getting closer, all of the global variables are gone, but now I'm paring down the number of arguments passed around by keeping the image-related state together.

    What am I looking for next? Well, it would be nice if I could just point people at a COPR repository or a PPA to get the binary. Is anyone willing to help with that?

    (I also keep getting requests for Windows builds, I have no clue on that

  48. Annoying I'm still not feeling great, so I'm now going to sleep it off a bit more. #unpaper 7.1 is getting closer, all of the global variables are gone, but now I'm paring down the number of arguments passed around by keeping the image-related state together.

    What am I looking for next? Well, it would be nice if I could just point people at a COPR repository or a PPA to get the binary. Is anyone willing to help with that?

    (I also keep getting requests for Windows builds, I have no clue on that

  49. Annoying I'm still not feeling great, so I'm now going to sleep it off a bit more. #unpaper 7.1 is getting closer, all of the global variables are gone, but now I'm paring down the number of arguments passed around by keeping the image-related state together.

    What am I looking for next? Well, it would be nice if I could just point people at a COPR repository or a PPA to get the binary. Is anyone willing to help with that?

    (I also keep getting requests for Windows builds, I have no clue on that

  50. Annoying I'm still not feeling great, so I'm now going to sleep it off a bit more. #unpaper 7.1 is getting closer, all of the global variables are gone, but now I'm paring down the number of arguments passed around by keeping the image-related state together.

    What am I looking for next? Well, it would be nice if I could just point people at a COPR repository or a PPA to get the binary. Is anyone willing to help with that?

    (I also keep getting requests for Windows builds, I have no clue on that

  51. Me: "I'm sure that the refactored #unpaper that has more semantically meaningful APIs rather than doing raw calculations is slower, I want to see how much."

    hyperfine: "Your CLANG / -O2 / LTO version is 2 seconds faster after the refactor than before."

    \meme{shocked_pikachu}

  52. Me: "I'm sure that the refactored #unpaper that has more semantically meaningful APIs rather than doing raw calculations is slower, I want to see how much."

    hyperfine: "Your CLANG / -O2 / LTO version is 2 seconds faster after the refactor than before."

    \meme{shocked_pikachu}

  53. Me: "I'm sure that the refactored #unpaper that has more semantically meaningful APIs rather than doing raw calculations is slower, I want to see how much."

    hyperfine: "Your CLANG / -O2 / LTO version is 2 seconds faster after the refactor than before."

    \meme{shocked_pikachu}

  54. Me: "I'm sure that the refactored #unpaper that has more semantically meaningful APIs rather than doing raw calculations is slower, I want to see how much."

    hyperfine: "Your CLANG / -O2 / LTO version is 2 seconds faster after the refactor than before."

    \meme{shocked_pikachu}

  55. Me: "I'm sure that the refactored #unpaper that has more semantically meaningful APIs rather than doing raw calculations is slower, I want to see how much."

    hyperfine: "Your CLANG / -O2 / LTO version is 2 seconds faster after the refactor than before."

    \meme{shocked_pikachu}