Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. i'm at a loss of words after reading a paper about reformatting code using an ML model that has a measured statistical quantity A_c which says how often the reformatted code behaves the same as the original

i'm at a loss of words after reading a paper about reformatting code using an ML model that has a measured statistical quantity A_c which says how often the reformatted code behaves the same as the original

Scheduled Pinned Locked Moved Uncategorized
140 Posts 61 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • whitequark@social.treehouse.systemsW whitequark@social.treehouse.systems

    @ireneista @GeoffWozniak based on a discussion with someone who has worked on this problem before we want to try building a diffusion model that captures the whitespace between code tokens and is then able to inject it into a given parsetree, which appears to be a fairly efficient and unproblematic way to do this

    kouhai@social.treehouse.systemsK This user is from outside of this forum
    kouhai@social.treehouse.systemsK This user is from outside of this forum
    kouhai@social.treehouse.systems
    wrote last edited by
    #104

    @whitequark @ireneista @GeoffWozniak ~~ah, so python indentation~~

    1 Reply Last reply
    0
    • nxskok@cupoftea.socialN nxskok@cupoftea.social

      @whitequark @deborahh @danlyke ie, the sort of thing a linter does?

      hennichodernich@radiosocial.deH This user is from outside of this forum
      hennichodernich@radiosocial.deH This user is from outside of this forum
      hennichodernich@radiosocial.de
      wrote last edited by
      #105

      @nxskok @whitequark @deborahh @danlyke to be fair, according to the paper, replacing for with while loops and vice versa and the like was also the goal

      illybytes@shrimp.imsofucking.gayI 1 Reply Last reply
      0
      • deborahh@cosocial.caD deborahh@cosocial.ca

        @whitequark @danlyke so … by "reformatted" I assume you mean aesthetically tidied up, with no change in functionality required?

        If I got that right: wtf?

        mrkeen@mastodon.socialM This user is from outside of this forum
        mrkeen@mastodon.socialM This user is from outside of this forum
        mrkeen@mastodon.social
        wrote last edited by
        #106

        @deborahh @whitequark @danlyke

        No.

        "there is no existing work that performs full stylization on an arbitrary piece of code. The most common methods are rule-based linters, formatters, which are limited to a few pre-defined style rules"

        whitequark@social.treehouse.systemsW 1 Reply Last reply
        0
        • mrkeen@mastodon.socialM mrkeen@mastodon.social

          @deborahh @whitequark @danlyke

          No.

          "there is no existing work that performs full stylization on an arbitrary piece of code. The most common methods are rule-based linters, formatters, which are limited to a few pre-defined style rules"

          whitequark@social.treehouse.systemsW This user is from outside of this forum
          whitequark@social.treehouse.systemsW This user is from outside of this forum
          whitequark@social.treehouse.systems
          wrote last edited by
          #107

          @mrkeen @deborahh @danlyke I do think that stretching the definition of what "code style" could reasonably refer to until it fits the shape of the research product is a part of the problem here. (Consider that the introduction explicitly refers to the gotofail bug as something the research is supposed to help with, whereas it is plainly evident that it would make that problem only worse.)

          1 Reply Last reply
          0
          • whitequark@social.treehouse.systemsW whitequark@social.treehouse.systems

            i'm at a loss of words after reading a paper about reformatting code using an ML model that has a measured statistical quantity A_c which says how often the reformatted code behaves the same as the original

            the "ideal" (their choice of words) case is 64.2%

            burningtyger@nrw.socialB This user is from outside of this forum
            burningtyger@nrw.socialB This user is from outside of this forum
            burningtyger@nrw.social
            wrote last edited by
            #108

            @whitequark I'm slightly embarrassed that this is coming from Germany.

            1 Reply Last reply
            0
            • disorderlyf@todon.euD disorderlyf@todon.eu

              @whitequark So let me get this straight, IEEE thinks you should count it as a win if rewriting your code by vibing it has less than 15% better odds than a literal coinflip of reproducibility?

              edited for clarity and to fix a typo

              urixturing@hachyderm.ioU This user is from outside of this forum
              urixturing@hachyderm.ioU This user is from outside of this forum
              urixturing@hachyderm.io
              wrote last edited by
              #109

              @disorderlyf @whitequark IEEE and ACM don't do the research nor they think you to do things, they are publishers that own journals and conferences where researchers publish their work

              whitequark@social.treehouse.systemsW disorderlyf@todon.euD 2 Replies Last reply
              0
              • whitequark@social.treehouse.systemsW whitequark@social.treehouse.systems

                @theeclecticdyslexic @lu_leipzig yeah if a formatter requires me to do things I don't want I simply quit using the formatter (and sometimes the codebase)

                burningtyger@nrw.socialB This user is from outside of this forum
                burningtyger@nrw.socialB This user is from outside of this forum
                burningtyger@nrw.social
                wrote last edited by
                #110

                @whitequark @theeclecticdyslexic @lu_leipzig You are absolutely right. So for JS/TS we're using eslint only. It is much less strict about things but gets the job done. Line length is one of my pet peeves. I simply cannot and don't want a strict length because sometimes a line is longer than the rest. For reasons. I don't use formatters either for that reason. Works well for me.

                1 Reply Last reply
                0
                • urixturing@hachyderm.ioU urixturing@hachyderm.io

                  @disorderlyf @whitequark IEEE and ACM don't do the research nor they think you to do things, they are publishers that own journals and conferences where researchers publish their work

                  whitequark@social.treehouse.systemsW This user is from outside of this forum
                  whitequark@social.treehouse.systemsW This user is from outside of this forum
                  whitequark@social.treehouse.systems
                  wrote last edited by
                  #111

                  @urixturing @disorderlyf yeah. there are other issues with their models but this isn't one

                  1 Reply Last reply
                  0
                  • whitequark@social.treehouse.systemsW whitequark@social.treehouse.systems

                    i'm at a loss of words after reading a paper about reformatting code using an ML model that has a measured statistical quantity A_c which says how often the reformatted code behaves the same as the original

                    the "ideal" (their choice of words) case is 64.2%

                    mc@mathstodon.xyzM This user is from outside of this forum
                    mc@mathstodon.xyzM This user is from outside of this forum
                    mc@mathstodon.xyz
                    wrote last edited by
                    #112

                    @whitequark well the paper speaks of *code style* which is more than just formatting but also, shouldn't we welcome negative results in science?

                    whitequark@social.treehouse.systemsW benjamineskola@hachyderm.ioB 2 Replies Last reply
                    0
                    • mc@mathstodon.xyzM mc@mathstodon.xyz

                      @whitequark well the paper speaks of *code style* which is more than just formatting but also, shouldn't we welcome negative results in science?

                      whitequark@social.treehouse.systemsW This user is from outside of this forum
                      whitequark@social.treehouse.systemsW This user is from outside of this forum
                      whitequark@social.treehouse.systems
                      wrote last edited by
                      #113

                      @mc I feel like if the negative result is obvious given the hypothesis it has a lot less value

                      1 Reply Last reply
                      0
                      • whitequark@social.treehouse.systemsW whitequark@social.treehouse.systems

                        i'm at a loss of words after reading a paper about reformatting code using an ML model that has a measured statistical quantity A_c which says how often the reformatted code behaves the same as the original

                        the "ideal" (their choice of words) case is 64.2%

                        S This user is from outside of this forum
                        S This user is from outside of this forum
                        sop@unstable.systems
                        wrote last edited by
                        #114

                        @whitequark I do think that asking for 100.0% equivalency is something that's both necessary to ask of something you'd want to put in a CI _and_ unreasonable to ask of something that tries to solve this problem

                        having accidentally gone through this specific kind of exercise a few times in the last couple weeks — turning java code into kotlin code intellij would spit into kotlin code I'd be happy to put my name on — I usually reach maybe 98% compatibility, then settle for that because I identify the remaining 2% of behaviours as "hard to replicate in the new shape of the code," "minor enough not to matter" and "not desirable, actually"

                        once you're happy to aim somewhere south than 100.0% I guess it's interesting to figure out how close you can get — and then yeah this approach only gets you to 64% which is only good as a milestone for future efforts to compare against 🤷‍♀️

                        maybe all this ends up being good for is dropping comments on PRs (and, if you recognize me, we both know how we feel about that)

                        whitequark@social.treehouse.systemsW S 2 Replies Last reply
                        0
                        • S sop@unstable.systems

                          @whitequark I do think that asking for 100.0% equivalency is something that's both necessary to ask of something you'd want to put in a CI _and_ unreasonable to ask of something that tries to solve this problem

                          having accidentally gone through this specific kind of exercise a few times in the last couple weeks — turning java code into kotlin code intellij would spit into kotlin code I'd be happy to put my name on — I usually reach maybe 98% compatibility, then settle for that because I identify the remaining 2% of behaviours as "hard to replicate in the new shape of the code," "minor enough not to matter" and "not desirable, actually"

                          once you're happy to aim somewhere south than 100.0% I guess it's interesting to figure out how close you can get — and then yeah this approach only gets you to 64% which is only good as a milestone for future efforts to compare against 🤷‍♀️

                          maybe all this ends up being good for is dropping comments on PRs (and, if you recognize me, we both know how we feel about that)

                          whitequark@social.treehouse.systemsW This user is from outside of this forum
                          whitequark@social.treehouse.systemsW This user is from outside of this forum
                          whitequark@social.treehouse.systems
                          wrote last edited by
                          #115

                          @sop but I'm not doing language translation, input and output are in the same language and should have essentially identical (machine-checkably equivalent) ASTs

                          1 Reply Last reply
                          0
                          • S sop@unstable.systems

                            @whitequark I do think that asking for 100.0% equivalency is something that's both necessary to ask of something you'd want to put in a CI _and_ unreasonable to ask of something that tries to solve this problem

                            having accidentally gone through this specific kind of exercise a few times in the last couple weeks — turning java code into kotlin code intellij would spit into kotlin code I'd be happy to put my name on — I usually reach maybe 98% compatibility, then settle for that because I identify the remaining 2% of behaviours as "hard to replicate in the new shape of the code," "minor enough not to matter" and "not desirable, actually"

                            once you're happy to aim somewhere south than 100.0% I guess it's interesting to figure out how close you can get — and then yeah this approach only gets you to 64% which is only good as a milestone for future efforts to compare against 🤷‍♀️

                            maybe all this ends up being good for is dropping comments on PRs (and, if you recognize me, we both know how we feel about that)

                            S This user is from outside of this forum
                            S This user is from outside of this forum
                            sop@unstable.systems
                            wrote last edited by
                            #116

                            @whitequark (reads https://social.treehouse.systems/@whitequark/116283070331505039) oh no did I just explain something you thought obvious back to you

                            whitequark@social.treehouse.systemsW 1 Reply Last reply
                            0
                            • S sop@unstable.systems

                              @whitequark (reads https://social.treehouse.systems/@whitequark/116283070331505039) oh no did I just explain something you thought obvious back to you

                              whitequark@social.treehouse.systemsW This user is from outside of this forum
                              whitequark@social.treehouse.systemsW This user is from outside of this forum
                              whitequark@social.treehouse.systems
                              wrote last edited by
                              #117

                              @sop i guess? basically, you can set up a system around an ML model in two ways: where the model gets to alter things that are not (lexer) whitespace, and where the model gets to alter random (lexer) tokens

                              the paper goes for #2
                              i am collabrating on a project that does #1, which gives 100.0% (with the caveat above) by design—because a formatting tool that sometimes breaks code is a net negative

                              1 Reply Last reply
                              0
                              • lu_leipzig@troet.cafeL lu_leipzig@troet.cafe

                                @whitequark And this is how research money is lit on fire, I guess. Why else conduct research into ML for a task that has had obvious, deterministic, efficient and well-tested solutions for decades?

                                srazkvt@tech.lgbtS This user is from outside of this forum
                                srazkvt@tech.lgbtS This user is from outside of this forum
                                srazkvt@tech.lgbt
                                wrote last edited by
                                #118

                                @lu_leipzig @whitequark i would honestly be more interested into a deterministic but very configurable formatter, and a ml model to, from sample code, write a config for you, and you just do minor adjustments to it, generally all code styles stand in just a few hundred switches

                                whitequark@social.treehouse.systemsW 1 Reply Last reply
                                0
                                • srazkvt@tech.lgbtS srazkvt@tech.lgbt

                                  @lu_leipzig @whitequark i would honestly be more interested into a deterministic but very configurable formatter, and a ml model to, from sample code, write a config for you, and you just do minor adjustments to it, generally all code styles stand in just a few hundred switches

                                  whitequark@social.treehouse.systemsW This user is from outside of this forum
                                  whitequark@social.treehouse.systemsW This user is from outside of this forum
                                  whitequark@social.treehouse.systems
                                  wrote last edited by
                                  #119

                                  @SRAZKVT @lu_leipzig this would be ~easy to do but convincing people to implement and maintain "a few hundred switches" has been incredibly difficult; my motivation is exactly that rustfmt maintainers have been consistently unwilling to entertain that

                                  whitequark@social.treehouse.systemsW 1 Reply Last reply
                                  0
                                  • whitequark@social.treehouse.systemsW whitequark@social.treehouse.systems

                                    @SRAZKVT @lu_leipzig this would be ~easy to do but convincing people to implement and maintain "a few hundred switches" has been incredibly difficult; my motivation is exactly that rustfmt maintainers have been consistently unwilling to entertain that

                                    whitequark@social.treehouse.systemsW This user is from outside of this forum
                                    whitequark@social.treehouse.systemsW This user is from outside of this forum
                                    whitequark@social.treehouse.systems
                                    wrote last edited by
                                    #120

                                    @SRAZKVT @lu_leipzig if every language i cared about (at this point: mainly rust, python, and c++) had highly configurable formatters i would not care to spend as much effort as i'm planning to on ml research

                                    srazkvt@tech.lgbtS 1 Reply Last reply
                                    0
                                    • whitequark@social.treehouse.systemsW whitequark@social.treehouse.systems

                                      @SRAZKVT @lu_leipzig if every language i cared about (at this point: mainly rust, python, and c++) had highly configurable formatters i would not care to spend as much effort as i'm planning to on ml research

                                      srazkvt@tech.lgbtS This user is from outside of this forum
                                      srazkvt@tech.lgbtS This user is from outside of this forum
                                      srazkvt@tech.lgbt
                                      wrote last edited by
                                      #121

                                      @whitequark @lu_leipzig most tooling devs today seem to believe in a one size fits all with no configurability, kind of sad

                                      also i think the problem of "but if every codebase isn't formatted exactly the same" is way overblown, once you start reading the code it really doesn't take long to adapt to a new style, barely a few minutes from my experience

                                      whitequark@social.treehouse.systemsW c0dec0dec0de@hachyderm.ioC 2 Replies Last reply
                                      0
                                      • srazkvt@tech.lgbtS srazkvt@tech.lgbt

                                        @whitequark @lu_leipzig most tooling devs today seem to believe in a one size fits all with no configurability, kind of sad

                                        also i think the problem of "but if every codebase isn't formatted exactly the same" is way overblown, once you start reading the code it really doesn't take long to adapt to a new style, barely a few minutes from my experience

                                        whitequark@social.treehouse.systemsW This user is from outside of this forum
                                        whitequark@social.treehouse.systemsW This user is from outside of this forum
                                        whitequark@social.treehouse.systems
                                        wrote last edited by
                                        #122

                                        @SRAZKVT @lu_leipzig there is a more real problem of "some people bounce off contributing if you ask them to fix style"

                                        srazkvt@tech.lgbtS 1 Reply Last reply
                                        0
                                        • sabik@rants.auS sabik@rants.au

                                          @xgranade @whitequark @porglezomp
                                          I think reversing the `j` for loop is actually wanted by them? It's labelled "ground truth", and it is a potential valid optimisation

                                          ingalovinde@embracing.spaceI This user is from outside of this forum
                                          ingalovinde@embracing.spaceI This user is from outside of this forum
                                          ingalovinde@embracing.space
                                          wrote last edited by
                                          #123

                                          @sabik @xgranade @whitequark @porglezomp but they also changed the boundaries! "Input" checks all values from 2 to i+2 inclusive; but "ground truth" just trows i+2 iteration out.

                                          sabik@rants.auS 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups