Closed ianbattersby closed 1 year ago
@ianbattersby I cannot reproduce this, with your config the startuptime is still < 1ms
I know you experience this after 9dc7caf7fb8a32b8a644daffb6c29d801a377b99 but the way compile works was drastically simplified:
Maybe some problem with git path modified time? Can you send the content of date.txt
, too little info was provided here.
Firstly, sincere apologies for raising this without more meticulous investigation. This came from wrestling a 6 year-old at the same time as trying to quickly raise the issue - but that's no excuse! 🙇
I can see now that the reason that particular commit is an issue that debug.getinfo(2)
should instead be debug.getinfo(1)
. I have no doubts this is fixed in a later commit. However, I do still suspect the hashing might be returning inconsistent results on my MBP M1 as fixing the fs_stat
comparison now avoids the compile comparison.
In fact, I've had issues previously with this. The previous hashing code I'd looked at (rightly) used pairs
over the more expensive ipairs
on every startup when iterating the user config table, and it would return the k/v pairs in a different order every time. I managed to workaround this by declaring my config more declaratively. It was because of this that after today's :PackerUpdate
I double-checked the profile times to see it had jumped up again.
Anyway, let me do the right thing. Close this and step away. Then come back with solid findings and cause 👍
No worries, happy wrestling :)
The table order is different everytime anyway because of the hash table nature
I use xor hashing which works regardless of the table order
The table order is different everytime anyway because of the hash table nature I use xor hashing which works regardless of the table order
That's super interesting, let that be the focus of my debugging. FYI: This is what I get when on HEAD of main
at the moment (after the simplification which means I'm now hitting the hash comparison immediately):
user conf: {
integrations= {
symbols_outline= "true",
gitsigns= "true",
mini= "true",
lsp_trouble= "true",
neotest= "true",
dap= {
enable_ui= "true",
enabled= "true",
},
which_key= "true",
treesitter= "true",
navic= {
custom_bg= "NONE",
enabled= "true",
},
notify= "true",
noice= "true",
mason= "true",
neotree= "true",
telescope= "true",
treesitter_context= "true",
},
transparent_background= "false",
term_colors= "true",
}
cached: 5411885691670184091
git path: /Users/ian/.local/share/nvim/site/pack/packer/start/catppuccin/.git/ORIG_HEAD
git: 1670184091
hashed: -19249237861670184091
user conf: {
integrations= {
symbols_outline= "true",
telescope= "true",
dap= {
enable_ui= "true",
enabled= "true",
},
navic= {
custom_bg= "NONE",
enabled= "true",
},
gitsigns= "true",
treesitter_context= "true",
neotree= "true",
mini= "true",
lsp_trouble= "true",
treesitter= "true",
neotest= "true",
notify= "true",
noice= "true",
which_key= "true",
mason= "true",
},
transparent_background= "false",
term_colors= "true",
}
cached: -19249237861670184091
git path: /Users/ian/.local/share/nvim/site/pack/packer/start/catppuccin/.git/ORIG_HEAD
git: 1670184091
hashed: -20412016251670184091
If I change the hash function's pairs
to ipairs
(which TBF now works pretty well at ~1.659292ms) then it works:
cached: 01670184091
git path: /Users/ian/.local/share/nvim/site/pack/packer/start/catppuccin/.git/ORIG_HEAD
git: 1670184091
hashed: 01670184091
NB: Let me try this on my Intel MBPR tomorrow and see if this is an ARM/M1 issue.
@ianbattersby ipairs ignore all values in the table which means your hash value is always 0 😂
@ianbattersby Using your config:
cached: -11000907001670176636
user conf: {
transparent_background = false,
term_colors = true,
integrations = {
mason = true,
notify = true,
mini = true,
neotest = true,
navic = {
enabled = false,
custom_bg = "NONE"
},
native_lsp = {
enabled = true,
underlines = {
errors = { "underline" },
information = { "underline" },
warnings = { "underline" },
hints = { "underline" }
},
virtual_text = {
errors = { "italic" },
information = { "italic" },
warnings = { "italic" },
hints = { "italic" }
}
},
dap = {
enabled = true,
enable_ui = true
},
telescope = true,
noice = true,
gitsigns = true,
treesitter = true,
lsp_trouble = true,
symbols_outline = true,
treesitter_context = true,
neotree = true,
which_key = true
}
}
git path: /home/nullchilly/.local/share/nvim/site/pack/packer/start/catppuccin/.git/ORIG_HEAD
git: 1670176636
hashed: -11000907001670176636
cached: -11000907001670176636
user conf: {
term_colors = true,
integrations = {
navic = {
custom_bg = "NONE",
enabled = false
},
native_lsp = {
underlines = {
information = { "underline" },
warnings = { "underline" },
hints = { "underline" },
errors = { "underline" }
},
enabled = true,
virtual_text = {
information = { "italic" },
warnings = { "italic" },
hints = { "italic" },
errors = { "italic" }
}
},
telescope = true,
notify = true,
dap = {
enable_ui = true,
enabled = true
},
treesitter = true,
lsp_trouble = true,
symbols_outline = true,
treesitter_context = true,
neotree = true,
which_key = true,
gitsigns = true,
noice = true,
mini = true,
neotest = true,
mason = true
},
transparent_background = false
}
git path: /home/nullchilly/.local/share/nvim/site/pack/packer/start/catppuccin/.git/ORIG_HEAD
git: 1670176636
hashed: -11000907001670176636
cached: -11000907001670176636
user conf: {
integrations = {
neotree = true,
which_key = true,
mason = true,
noice = true,
mini = true,
neotest = true,
gitsigns = true,
telescope = true,
notify = true,
navic = {
enabled = false,
custom_bg = "NONE"
},
native_lsp = {
virtual_text = {
warnings = { "italic" },
hints = { "italic" },
errors = { "italic" },
information = { "italic" }
},
enabled = true,
underlines = {
warnings = { "underline" },
hints = { "underline" },
errors = { "underline" },
information = { "underline" }
}
},
dap = {
enabled = true,
enable_ui = true
},
treesitter = true,
lsp_trouble = true,
symbols_outline = true,
treesitter_context = true
},
transparent_background = false,
term_colors = true
}
git path: /home/nullchilly/.local/share/nvim/site/pack/packer/start/catppuccin/.git/ORIG_HEAD
git: 1670176636
hashed: -11000907001670176636
All hash returns -11000907001670176636
@ianbattersby ipairs ignore all values in the table which means your hash value is always 0 😂
LOL 😂
OK, so these are the results from my work Intel machine, and it works. So perhaps this is a LuaJIT on M1 issue? I have a new M1 Pro coming today so will be doing a fresh install on there. I'm intrigued to see what it shows! 🕵️
This is like a proper detective mystery 😂
{
transparent_background= "false",
term_colors= "true",
integrations= {
which_key= "true",
treesitter_context= "true",
gitsigns= "true",
neotree= "true",
mini= "true",
neotest= "true",
mason= "true",
dap= {
enabled= "true",
enable_ui= "true",
},
notify= "true",
telescope= "true",
treesitter= "true",
navic= {
enabled= "true",
custom_bg= "NONE",
},
noice= "true",
symbols_outline= "true",
lsp_trouble= "true",
},
}
cached: -16247770471670231775
hash: -16247770471670231775
LOAD 2 (Intel MBPR 16" i7 2018)
{
transparent_background= "false",
term_colors= "true",
integrations= {
telescope= "true",
neotest= "true",
navic= {
custom_bg= "NONE",
enabled= "true",
},
noice= "true",
dap= {
enable_ui= "true",
enabled= "true",
},
which_key= "true",
treesitter= "true",
notify= "true",
treesitter_context= "true",
symbols_outline= "true",
gitsigns= "true",
mini= "true",
lsp_trouble= "true",
mason= "true",
neotree= "true",
},
}
cached: -16247770471670231775
hash: -16247770471670231775
FWIW, I can confirm that using the local implementation (with local B = require "catppuccin.lib.native_bit"
) works on M1:
cached: -19488184521670233784
hash: -19488184521670233784
So could be the interim solution (should you wish to adopt one) is to detect aarch64
and use local .. but meh 🤔
Pretty sure luajit only recently supported aarch64 (Still not working on armv7)
https://github.com/LuaJIT/LuaJIT/issues/49 I found this issue related to arm but the thing is murmurhash used right shift so I am 90% sure it can't surpass 47 bit address...
Maybe some undefined behavior with murmurhash https://github.com/grpc/grpc/issues/13221 😓
Where could I contact you for a live conversation (Do you have discord?)
Where could I contact you for a live conversation (Do you have discord?)
I'm on Discord as ianbattersby#8868
but may be unresponsive whilst in meetings 👍
Friend request sent 👍🏻
Description
If I revert to
72540852ca
then startup hash comparison and compilation works correctly, in that it produces the same hash every time and uses the cached data. However, if I rebase to9dc7caf7fb8
then the compile hash on each startup is different (regardless of what is stored in.cache/nvim/catppuccin
. I'll try and send a PR if I get time to figure this out, but wanted to log it here in case others are seeing the same and scratching their heads :innNeovim version
Operating system and version
macOS 13.0.1
Catppuccin version / branch / rev
cappuccino v0.2.7
Steps to reproduce
git reset --hard 72540852ca00d7842ea1123635aecb9353192f0b
nvim
cat ~/.cache/nvim/config.json
-->XYZ123
nvim
cat ~/.cache/nvim/config.json
-->XYZ123
git reset --hard 9dc7caf7fb8a32b8a644daffb6c29d801a377b99
nvim
cat ~/.cache/nvim/date.txt
-->XYZ456
nvim
cat ~/.cache/nvim/date.txt
-->XYZ789
Expected behavior
The same configuration (unchanged) should result in the same hash on startup and use compiled data.
Actual behavior
Produces different hash on every load using same configuration, and recompiles (10ms+ vs ~1ms).
Minimal config