Neovim/slime/tmux and bracketed-paste

These are my julia plugins for neovim, I do use the default neovim lsp

    Plug 'JuliaEditorSupport/julia-vim'
    Plug 'jpalardy/vim-slime'
    Plug 'autozimu/LanguageClient-neovim', {'branch': 'next', 'do': 'bash install.sh'}

I don’t use things like OhMyRepl.jl, and some quick test also didn’t seem to help,
but I am happy to change my julia setup if that helps.

Looking at the ~/.slime_paste buffer that holds the last send text it does indeed look like there is an issue with the block sending. The buffer file only contains the lower half of my testcase, so I assume it is sending my testset in multiple blocks? The julia repl still shows the whole testcase as one single block/command/history entry, but I guess the bracketed-paste special symbols get messed up?

Just for completeness, the testcase does work fine if I just run
julia --project dot.jl

~/.slime_paste
➜  Enzyme.jl git:(axpy) cat ~/.slime_paste 
            fdm, (x, y) -> fun(n, x, inc, y, inc), one(Float32), x, y
            )
            @show inc
            ret = autodiff(
                ReverseWithPrimal,
                fun,
                Tret,
                Const(n),
                x_annot,
                Const(inc),
                y_annot,
                Const(inc),
            )
            dval, val = ret

            @test all(isnothing, dval)
            @test val ≈ vexp
            @test ∂xcopy ≈ dexp[1] * !(Tx <: Const || Tret <: Const) + ∂x
            @test ∂ycopy ≈ dexp[2] * !(Ty <: Const || Tret <: Const) + ∂y
        end
    end
end%    
Full Testcase
julia> @testset "BLAS rules" begin                                                                                                                                                                                                                                                                                                                                                                                                      
           fdm = central_fdm(5, 1)                                                                                                                                                                                                                                                                                                                                                                                                      
           RTs = (Float32, Float64)  
           n = 10

           fun = BLAS.dot

           #Enzyme.API.print!(true)
           @testset "reverse" begin

               @testset for Tret in (Active,),
                   Tx in (Const,),
                   Ty in (Duplicated,),
                   pfun in (identity,),
                   #T in (Float32,),
                   (sz, inc) in ((10, 1), ((2, 20), -2)),

                   Tx <: Const && Ty <: Const && !(Tret <: Const) && continue

                   x, ∂x = ntuple(_ -> randn(Float32, sz), 2)
                   y, ∂y = ntuple(_ -> randn(Float32, sz), 2)
                   ∂z = randn(Float32)
                   xcopy, ycopy, ∂xcopy, ∂ycopy = map(copy, (x, y, ∂x, ∂y))

                   x_annot =
                       Tx <: Const ? Const(pfun(x)) : Duplicated(pfun(xcopy), pfun(∂xcopy))
                   y_annot =
                       Ty <: Const ? Const(pfun(y)) : Duplicated(pfun(ycopy), pfun(∂ycopy))

                   vexp = fun(n, x, inc, y, inc)
                   dexp = FiniteDifferences.j′vp(
                       fdm, (x, y) -> fun(n, x, inc, y, inc), one(Float32), x, y
                   )
                   @show inc
                   ret = autodiff(
                       ReverseWithPrimal,
                       fun,
                       Tret,
                       Const(n),
                       x_annot,
                       Const(inc),
                       y_annot,
                       Const(inc),
                   )
                   dval, val = ret

                   @test all(isnothing, dval)
                   @test val ≈ vexp
                   @test ∂xcopy ≈ dexp[1] * !(Tx <: Const || Tret <: Const) + ∂x
                   @test ∂ycopy ≈ dexp[2] * !(Ty <: Const || Tret <: Const) + ∂y
               end
           end
       end
ERROR: syntax: invalid iteration specification
Stacktrace:
 [1] top-level scope
   @ none:1


Well it turns out that while getting the small testcase fixed using the bracketed pasting mode I did modify the large testcase without noticing, so it was actually invalid julia at the end of the day. So I did fix the actual slime issue a long time ago without noticing. sigh

2 Likes