Investigate Windows Commit charge for snmalloc

@aganea has enabled snmalloc, mimalloc, and rpmalloc to be the allocator for lld-link.  He has benchmarked this with performing ThinLTO on a clang build.  The results taken from https://reviews.llvm.org/D71786 are

Allocator
Wall clock
Page ranges commited/decommited
Total touched pages
Peak Mem

Windows 10 version 2004
38 min 47 sec

14.9 GB

mimalloc
2 min 22 sec
1,449,501
174,3 GB
19,8 GB

rpmalloc
2 min 15 sec
270,796
45,9 GB
31,9 GB

snmalloc
2 min 19 sec
102,839
47,0 GB
42,0 GB

The time is pretty comparable, but this shows snmalloc on Windows as committing considerably more memory than other allocators.
Experiments to try

Different "chunk" size, 16MiB versus 1MiB.
Sub chunk, commit/decommit operations

@davidchisnall mentionned: "By default, on Windows, snmalloc only decommits memory when the kernel notifies it that memory is constrained.  If you've got loads of spare memory, there's no problem letting the commit size grow a lot, it's only a negative if the memory could be usefully used for something else."
The test machine has 128 GB of RAM and memory is far from being constrained. I will nevertheless re-test with IS_ADDRESS_SPACE_CONSTRAINED and the latest master branch. My test was using the tree_index branch.

Figures with latest master:

Allocator
Wall clock
Page ranges commited/decommited
Total touched pages
Peak Mem

default
2 min 21 sec
73,611
43,8 GB
42,6 GB

+IS_ADDRESS_SPACE_CONSTRAINED
2 min 21 sec
48,836
92,7 GB
21,6 GB

That looks a lot more plausible.  We should probably rename IS_ADDRESS_SPACE_CONSTRAINED: it's a bit misleading.  Since @mjp41's recent work, we rarely see a performance advantage from using 16MiB super slabs, I wonder if we should consider adjusting the default to 1MiB (or 2MiB, which would play nicely with superpages on x86).

@aganea thank you so much for running more tests. I wonder if the small regression in performance is not using the tree_index branch.  That should have improved Windows performance a bit. I have rebased the tree_index branch onto master, so we can test those changes again, so see if they account for the regression.
I have been setting up an LLVM Windows build, so I can test the link time.   Just wanted to confirm I am doing the same as you
cmake ..\llvm-project\llvm \
   -DLLVM_ENABLE_LTO=On \
   -DCMAKE_LINKER=c:/src/malloc-llvm/build/lld-link.exe \
   -DLLVM_ENABLE_PROJECTS=clang \
   -DCMAKE_BUILD_TYPE=Release \
   -DCMAKE_C_COMPILER=c:/src/malloc-llvm/build/bin/clang-cl.exe \
   -DCMAKE_CXX_COMPILER=c:/src/malloc-llvm/build/bin/clang-cl.exe \
   -G Ninja

When building this, I assume you are measuring the final step
Linking CXX executable bin\clang.exe

I am building with the latest master, but I haven't tried to apply your patch yet.  Just getting the very slow version with lld-link so far.

@davidchisnall  I think moving to the 1MiB size as default would make a lot of sense. I think 1MiB could work well with a little fiddling around huge pages, so we can put two threads into one huge page, for low-memory multi-threaded scenarios.
Agreed IS_ADDRESS_SPACE_CONSTRAINED is a terrible name, I named it after why I needed it originally, rather than what it does.
@licenser, @darach, @SchrodingerZhu any thoughts on changing the default to 1MiB?

This comment contains some benchmarking using the microbenchmarks for mimalloc for the different chunk sizes.
@plietar  any thoughts on changing the default to 1MiB?

@aganea thank you so much for running more tests.
 You folks have been very helpful so far :)

Just wanted to confirm I am doing the same as you
In essence, you have to do a two-stage LLVM build.

git checkout https://github.com/llvm/llvm-project -or- git pull, then git apply https://reviews.llvm.org/D71786
The first stage builds LLVM with the bootstrap compiler (any compiler). You could use the allocator at this point if you wish.
The second stage builds LLVM with with the 1st stage. At this point cmake uses ThinLTO & the allocator & O3 & -march=skylake or whatever your CPU is to ensure max. perfomance.
Once everything is built, delete buildstage2\bin\clang.exe, then re-run ninja clang -v. This link should last a bit, go into the folder buildstage2\CMakeFiles and copy clang.rsp (which is temp file created during link) to clang2.rsp. You can cancel the link at the point.
Put the following line in a new file buildstage2\link.rsp: /nologo @CMakeFiles\clang2.rsp  /out:bin\clang.exe /implib:lib\clang.lib /pdb:bin\clang.pdb /version:0.0  /machine:x64 -fuse-ld=lld /STACK:10000000 /DEBUG /OPT:REF /OPT:ICF /INCREMENTAL:NO /subsystem:console /opt:lldltojobs=all. All these gymnastics are needed because there's no option to disable the ThinLTO from cmake, nor an option to use all hardware threads (by default, only one thread per core is used).
You only need to do the above steps once. You can now run the test with:

> cd buildstage2
> bin\lld-link @link.rsp

I use Bruce Dawson's UIforETW to take profile traces: https://github.com/google/UIforETW - ensure to check 'trace to file' first on the right side. Click 'Start Tracing' at the top before running the above cmd-line, then 'Save Trace Buffers' once it ends. After it is done compressing the trace, double-clicking on it would open WPA. If the traces are too big and you get out-of-memory crashes, set the following the wpa.config file next to wpa.exe:
<configuration>
  ...
  <runtime>
   	<gcAllowVeryLargeObjects enabled="true" />
  </runtime>
</configuration>

I've attached my build script:
make_llvm_snmalloc.zip
You need to run it from a VS 2017 or 2019 x64 Native Tools Command Prompt:
D:\llvm-project> make_llvm_snmalloc.bat buildStage1
D:\llvm-project> ninja check-all -C buildStage1
D:\llvm-project> make_llvm_snmalloc.bat buildStage2
D:\llvm-project> ninja check-all -C buildStage2

GnuWin32, Python 3.8, ninja are also needed.
Please let me know if there're difficulties along the way.

We're running it with default-features = false so it won't affect us but I'll try to get in some benchmarks on Monday of the impact of 1mb vs no features :)

on a small linux openvz instance (2Gib in total), after upgrading to snmalloc-rs==0.2.16, I run into Out of memory on initialisation with and without 1mib flag.
The following rust is not very useful, but I may have time to check the problem further:
Out of memory
/bin/utopia(+0x62ff7b)[0x56062d9fdf7b]
/bin/utopia(+0x6304b3)[0x56062d9fe4b3]
/bin/utopia(+0x630511)[0x56062d9fe511]
/bin/utopia(+0x630b72)[0x56062d9feb72]
/bin/utopia(+0x6340fc)[0x56062da020fc]
/bin/utopia(+0x3c75e3)[0x56062d7955e3]
/bin/utopia(+0x17c2a7)[0x56062d54a2a7]
/lib64/libc.so.6(__libc_start_main+0xf3)[0x7f27569406a3]
/bin/utopia(+0xe8ede)[0x56062d4b6ede]

I confirmed that this was resulted by snmalloc since using system default malloc will solve the memory issue. This problem occurs right after upgrading to 0.2.16 (94a2ba4).

well, I think I can reproduce the problem with firejail --noprofile --rlimit-as=2147483648.

firejail --noprofile --rlimit-as=2147483648 bash: no problem
firejail --noprofile --rlimit-as=2147483648 --env=LD_PRELOAD=/tmp/snmalloc/test/libsnmallocshim.so bash: dead
firejail --noprofile --env=LD_PRELOAD=/tmp/snmalloc/test/libsnmallocshim.so bash: no problem

[schrodinger@Monad utopia]$ ulimit -Sv 500000
[schrodinger@Monad utopia]$ strace env LD_PRELOAD=/tmp/snmalloc/test/libsnmallocshim.so bash
execve("/usr/bin/env", ["env", "LD_PRELOAD=/tmp/snmalloc/test/li"..., "bash"], 0x7ffe909ace00 /* 69 vars */) = 0
brk(NULL)                               = 0x55a2b674d000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffe9daa37e0) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK)      = 0
openat(AT_FDCWD, "/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
close(3)                                = 0
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=458620, ...}) = 0
mmap(NULL, 458620, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0ca548a000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3<EMAIL_ADDRESS>832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0<EMAIL_ADDRESS>784, 64) = 784
pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\346~\200\347\6\31qw\t\343\30\16U*\21\242"..., 68, 880) = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=2146832, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0ca5488000
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0<EMAIL_ADDRESS>784, 64) = 784
pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\346~\200\347\6\31qw\t\343\30\16U*\21\242"..., 68, 880) = 68
mmap(NULL, 1860456, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0ca52c1000
mprotect(0x7f0ca52e6000, 1671168, PROT_NONE) = 0
mmap(0x7f0ca52e6000, 1363968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f0ca52e6000
mmap(0x7f0ca5433000, 303104, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x172000) = 0x7f0ca5433000
mmap(0x7f0ca547e000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bc000) = 0x7f0ca547e000
mmap(0x7f0ca5484000, 13160, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0ca5484000
close(3)                                = 0
arch_prctl(ARCH_SET_FS, 0x7f0ca5489580) = 0
mprotect(0x7f0ca547e000, 12288, PROT_READ) = 0
mprotect(0x55a2b5e45000, 4096, PROT_READ) = 0
mprotect(0x7f0ca5525000, 4096, PROT_READ) = 0
munmap(0x7f0ca548a000, 458620)          = 0
brk(NULL)                               = 0x55a2b674d000
brk(0x55a2b676e000)                     = 0x55a2b676e000
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=6187360, ...}) = 0
mmap(NULL, 6187360, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0ca4cda000
close(3)                                = 0
execve("/home/schrodinger/.opam/default/bin/bash", ["bash"], 0x55a2b674e550 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/var/lib/snapd/snap/bin/bash", ["bash"], 0x55a2b674e550 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/home/schrodinger/.idris2/bin/bash", ["bash"], 0x55a2b674e550 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/opt/mpich/bin/bash", ["bash"], 0x55a2b674e550 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/home/schrodinger/.local/bin/bash", ["bash"], 0x55a2b674e550 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/opt/intel/system_studio_2020/compilers_and_libraries/linux/bin/intel64/bash", ["bash"], 0x55a2b674e550 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/opt/testa/bin/bash", ["bash"], 0x55a2b674e550 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/home/schrodinger/.cargo/bin/bash", ["bash"], 0x55a2b674e550 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/usr/local/bin/bash", ["bash"], 0x55a2b674e550 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/usr/local/sbin/bash", ["bash"], 0x55a2b674e550 /* 70 vars */) = -1 ENOENT (No such file or directory)
execve("/usr/bin/bash", ["bash"], 0x55a2b674e550 /* 70 vars */) = 0
brk(NULL)                               = 0x557ec3ddb000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffe95b408f0) = -1 EINVAL (Invalid argument)
openat(AT_FDCWD, "/tmp/snmalloc/test/libsnmallocshim.so", O_RDONLY|O_CLOEXEC) = 3
read(3<EMAIL_ADDRESS>832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1880712, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1659e35000
mmap(NULL, 16998432, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1658dfe000
mmap(0x7f1658dff000, 57344, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f1658dff000
mmap(0x7f1658e0d000, 147456, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f1658e0d000
mmap(0x7f1658e31000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x32000) = 0x7f1658e31000
mmap(0x7f1658e33000, 16781344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f1658e33000
close(3)                                = 0
access("/etc/ld.so.preload", R_OK)      = 0
openat(AT_FDCWD, "/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
close(3)                                = 0
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=458620, ...}) = 0
mmap(NULL, 458620, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f1658d8e000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libreadline.so.8", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 `\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=326416, ...}) = 0
mmap(NULL, 334344, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1658d3c000
mmap(0x7f1658d52000, 163840, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7f1658d52000
mmap(0x7f1658d7a000, 40960, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3e000) = 0x7f1658d7a000
mmap(0x7f1658d84000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x47000) = 0x7f1658d84000
mmap(0x7f1658d8d000, 2568, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f1658d8d000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\22\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=18608, ...}) = 0
mmap(NULL, 20624, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1658d36000
mmap(0x7f1658d37000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x7f1658d37000
mmap(0x7f1658d39000, 4096, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f1658d39000
mmap(0x7f1658d3a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f1658d3a000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3<EMAIL_ADDRESS>832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0<EMAIL_ADDRESS>784, 64) = 784
pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\346~\200\347\6\31qw\t\343\30\16U*\21\242"..., 68, 880) = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=2146832, ...}) = 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0<EMAIL_ADDRESS>784, 64) = 784
pread64(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32, 848) = 32
pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0\346~\200\347\6\31qw\t\343\30\16U*\21\242"..., 68, 880) = 68
mmap(NULL, 1860456, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1658b6f000
mprotect(0x7f1658b94000, 1671168, PROT_NONE) = 0
mmap(0x7f1658b94000, 1363968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7f1658b94000
mmap(0x7f1658ce1000, 303104, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x172000) = 0x7f1658ce1000
mmap(0x7f1658d2c000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bc000) = 0x7f1658d2c000
mmap(0x7f1658d32000, 13160, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f1658d32000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\201\0\0\0\0\0\0"..., 832) = 832
pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0:(A\261\254\325W\2768O\340i9\4#\234"..., 68, 824) = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=161024, ...}) = 0
pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0:(A\261\254\325W\2768O\340i9\4#\234"..., 68, 824) = 68
mmap(NULL, 135600, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1658b4d000
mmap(0x7f1658b54000, 65536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7f1658b54000
mmap(0x7f1658b64000, 20480, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f1658b64000
mmap(0x7f1658b69000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x7f1658b69000
mmap(0x7f1658b6b000, 12720, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f1658b6b000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libatomic.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0  \0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=167952, ...}) = 0
mmap(NULL, 36936, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1658b43000
mmap(0x7f1658b45000, 12288, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f1658b45000
mmap(0x7f1658b48000, 8192, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7f1658b48000
mmap(0x7f1658b4a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f1658b4a000
mmap(0x7f1658b4c000, 72, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f1658b4c000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3<EMAIL_ADDRESS>832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=20945112, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1658b41000
mmap(NULL, 1951744, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1658964000
mprotect(0x7f16589fa000, 1269760, PROT_NONE) = 0
mmap(0x7f16589fa000, 966656, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x96000) = 0x7f16589fa000
mmap(0x7f1658ae6000, 299008, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x182000) = 0x7f1658ae6000
mmap(0x7f1658b30000, 57344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1cb000) = 0x7f1658b30000
mmap(0x7f1658b3e000, 10240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f1658b3e000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260\363\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1328000, ...}) = 0
mmap(NULL, 1327128, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f165881f000
mmap(0x7f165882e000, 634880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f165882e000
mmap(0x7f16588c9000, 626688, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xaa000) = 0x7f16588c9000
mmap(0x7f1658962000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x142000) = 0x7f1658962000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libncursesw.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 p\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=457736, ...}) = 0
mmap(NULL, 462072, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f16587ae000
mmap(0x7f16587c5000, 245760, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f16587c5000
mmap(0x7f1658801000, 98304, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x53000) = 0x7f1658801000
mmap(0x7f1658819000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6a000) = 0x7f1658819000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0 0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=595552, ...}) = 0
mmap(NULL, 103144, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1658794000
mmap(0x7f1658797000, 69632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x3000) = 0x7f1658797000
mmap(0x7f16587a8000, 16384, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x7f16587a8000
mmap(0x7f16587ac000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f16587ac000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1658792000
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f165878f000
arch_prctl(ARCH_SET_FS, 0x7f165878f780) = 0
mprotect(0x7f1658d2c000, 12288, PROT_READ) = 0
mprotect(0x7f16587ac000, 4096, PROT_READ) = 0
mprotect(0x7f1658819000, 20480, PROT_READ) = 0
mprotect(0x7f1658962000, 4096, PROT_READ) = 0
mprotect(0x7f1658b30000, 53248, PROT_READ) = 0
mprotect(0x7f1658b69000, 4096, PROT_READ) = 0
mprotect(0x7f1658b4a000, 4096, PROT_READ) = 0
mprotect(0x7f1658d3a000, 4096, PROT_READ) = 0
mprotect(0x7f1658d84000, 12288, PROT_READ) = 0
mprotect(0x7f1658e31000, 4096, PROT_READ) = 0
mprotect(0x557ec257d000, 12288, PROT_READ) = 0
mprotect(0x7f1659e62000, 4096, PROT_READ) = 0
munmap(0x7f1658d8e000, 458620)          = 0
set_tid_address(0x7f165878fa50)         = 2446087
set_robust_list(0x7f165878fa60, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7f1658b54bf0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f1658b61960}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f1658b54c90, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f1658b61960}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
mmap(NULL,<PHONE_NUMBER>, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0xb), ...}) = 0

@schrodingerzhu I have raised an issue for what you have reported. I believe it is independent of the Windows commit issue.

So I ran our benchmark with and without 1mib and I couldn't see any significant difference.

@licenser did you monitor RSS, or just throughput.  If you did monitor RSS, do you have transparent huge pages enabled?

I just looked at throughput we don't have any benchmarks that look at memory, sorry.

@Licenser thanks for doing this.

@aganea I have replicated the experiment so far.  I have checked out a Standard F72s_v2 (72 vcpus, 144 GiB memory) on Azure with Windows 10 instance, and am getting about 32GiB PWS with the 16MiB chunk size, and 16GiB PWS with the 1MiB chunk size.  The times look like they might be slightly faster with 16MiB, but not sure, so running some statistically meaningful tests.  Also re-tested the tree_index branch.
One minor tip, you can do ninja -v -d keeprsp, then you don't have to worry about the rsp file being deleted by ninja in step 3 of your instructions.

@aganea I have also got rpmalloc and mimalloc working in the way your patch describes.
Initially, I am observing rpmalloc as slightly slower than snmalloc, but mimalloc is quite a bit slower.  Is there anything I might be missing in building mimalloc. I manually applied your patch, and then did
msbuild mimalloc.sln /m /P:Configuration=Release /t:rebuild

from the ide\vs2019 directory.
Obviously, the machines are different, so we should expect different results. As this is running in the Cloud the cost of various operations are different, and may occur contention in Hyper-V.
It is definitely not running the system heap, as it is getting up to a reasonable percentage CPU utilization, which the system allocator does not.

@mjp41 What Windows 10 version is the underlying cloud system? It might definitly be something related to allocating hardware pages on the underlying system. mimalloc makes a lot more calls to VirtualAlloc than rpmalloc than snmalloc. Please take a ETW trace, then in WPA go the RandomAscii inclusive view, filter to selection lld-link, than add a colum module and function, in this order: Process, Module, Function. You'll be able to tell pretty quickly where the bottleneck is. Normally, ntdll.dll & ntoskrnl.exe combined shouldn't take more that 0.5% of CPU, and most of the time is spent by xperf capturing callstacks.

@aganea it is running in Azure, so I assume HyperV at the bottom, and Windows 10 version 1809 as the OS.
Looking at the traces it is spending a lot of time inside ntoskrnl.dll inside spin locks, about 45%.  I haven't drilled into the traces much, but I think it is seems to be around page handling.

If the instance is running on 1809, then the behavior you're seeing is 'normal'.
This is a known issue in the NT kernel, there was a contention in the page zero-out mechanism: https://stackoverflow.com/questions/45024029/windows-10-poor-performance-compared-to-windows-7-page-fault-handling-is-not-sc
This was fixed after version 1903.
Same dataset, same LLD linker:

However after 1909 there's a new contention issue in the large page allocation -- I don't know if it was fixed in version 2004: https://twitter.com/alex_toresh/status/1215125422226231297

Okay, I'll try to update the VM.  Though, Windows update wants to go to 1909.
Looking at the numbers on the machine today rpmalloc and 16MiB configuration were about the same, and the 1MiB was slightly slower, but all pretty close and within the level of noise, so would actually have to do some statistics to draw a conclusion.  The machine Azure gave me yesterday, had rpmalloc as slightly slower, I didn't run enough tests to see if it was statistically significant though.
Memory usage was approximately as you saw but off by a factor.

16MiB configuration - 32.4Gb
1MiB configuration - 16.2 Gb
rpmalloc - 28 Gb (Not tried the array-cache branch yet)
mimalloc - 14.3 Gb

So my VM upgraded to 1909 and now mimalloc is even worse.  On this machine it is giving rpmalloc about 5% faster then snmalloc 1MiB, with the 16 MiB in the middle of them. Memory usage looks about the same.
I am going to move to 1MiB as the default.  It works much better in terms of RSS/PSW, and there are very few scenarios where the reduced throughput seem too costly.

We're running it with default-features = false so it won't affect us but I'll try to get in some benchmarks on Monday of the impact of 1mb vs no features :)

If you are using the rust crate, it has been just updated and it now requires setting either the 1mib feature or the 16mib feature.
This is a broken change if you are using default-features=false.


Feature/templates

Did you review the templates with Andrey?
That was his templates file, so yeah. As for the other templates, I told him that it would come in a later stage
Perhaps having to manually delete them would be safer
There are many issues related to drafts and templates, I must confess that the system is pretty fragile and poorly constructed, but I tried to make the best of it. There are strict requirements on what data should the activities contain before they can be saved to the backend even as a draft, so that's what motivated the current intended behaviour


CUDA runtime error while pressure test

Inference failed while using ab with more than 3 concurrency but was ok with 1 or 2 concurrency.  Using an A10G GPU, with Driver Version: 545.23.06，CUDA Version: 12.3， trt version：9.1， vicuna 13b-1.5-16k。Have any workround？
[TensorRT-LLM][WARNING] Step function failed, continuing.
2023-11-01 10:20:21,882 PID:111 INFO totally input 7 tokens
[TensorRT-LLM][ERROR] Encountered an error in forward function: [TensorRT-LLM][ERROR] CUDA runtime error in ::cudaEventSynchronize(get()): an illegal memory access was encountered (/app/tensorrt_llm/cpp/include/tensorrt_llm/runtime/cudaEvent.h:66)
1       0x7f2d2e81e045 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x36045) [0x7f2d2e81e045]
2       0x7f2d2e87fa8a /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x97a8a) [0x7f2d2e87fa8a]
3       0x7f2d2e84c821 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x64821) [0x7f2d2e84c821]
4       0x7f2d2e8515c7 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x695c7) [0x7f2d2e8515c7]
5       0x7f2d2e83b241 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x53241) [0x7f2d2e83b241]
6       0x7f2d2e83c38a /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x5438a) [0x7f2d2e83c38a]
7       0x7f2d92e64253 /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc253) [0x7f2d92e64253]
8       0x7f2d92bf4ac3 /usr/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x7f2d92bf4ac3]
9       0x7f2d92c85bf4 clone + 68
[TensorRT-LLM][ERROR] Encountered error for requestId 760313751: Encountered an error in forward function: [TensorRT-LLM][ERROR] CUDA runtime error in ::cudaEventSynchronize(get()): an illegal memory access was encountered (/app/tensorrt_llm/cpp/include/tensorrt_llm/runtime/cudaEvent.h:66)
1       0x7f2d2e81e045 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x36045) [0x7f2d2e81e045]
2       0x7f2d2e87fa8a /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x97a8a) [0x7f2d2e87fa8a]
3       0x7f2d2e84c821 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x64821) [0x7f2d2e84c821]
4       0x7f2d2e8515c7 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x695c7) [0x7f2d2e8515c7]
5       0x7f2d2e83b241 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x53241) [0x7f2d2e83b241]
6       0x7f2d2e83c38a /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x5438a) [0x7f2d2e83c38a]
7       0x7f2d92e64253 /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc253) [0x7f2d92e64253]
8       0x7f2d92bf4ac3 /usr/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x7f2d92bf4ac3]
9       0x7f2d92c85bf4 clone + 68
[TensorRT-LLM][WARNING] Step function failed, continuing.

@jiangshining Thank you for the report. Can you share end to end reproduced steps to help us reproducing the issue you encounter? It is helpful to prevent spending too many time to align the test settings.

i've got the same Issue (baichuan2 13b, with max bs=2, concurrency=4 triton=23.08)
however, it seems to be solved when i tried triton trtllm 23.10 ngc image today, you can try to upgrade it maybe

@byshiue I came across the same issue as follow steps:

build llama2 7B engine from tensorrt-llm/examples/llama, build.py with following building args:

            "args": [
                "--max_batch_size", "4",
                "--max_input_len", "4096",
                "--max_output_len", "258",
                "--model_dir", "./llama-2-7b-chat-hf",
                "--dtype", "float16",
                "--remove_input_padding",
                "--use_gpt_attention_plugin", "float16",
                "--enable_context_fmha",
                "--use_gemm_plugin", "float16",
                "--use_inflight_batching",
                "--paged_kv_cache",
                "--use_weight_only",
                "--weight_only_precision", "int4",
                "--output_dir", "./tmp/llama/7B/trt_engines/int4_inflightb_btsz4/1-gpu/"
            ]

config and start the triton server

max_batch_size: 4
model_transaction_policy {
  decoupled: False
}
parameters: {
  key: "gpt_model_type"
  value: {
    string_value: "inflight_fused_batching"
  }
}
parameters: {
  key: "gpt_model_path"
  value: {
    string_value: "/workspace/tensorrtllm_backend/triton_model_repo/tensorrt_llm/1"
  }
}
parameters: {
  key: "batch_scheduler_policy"
  value: {
    string_value: "guaranteed_no_evict"
  }
}
parameters: {
  key: "kv_cache_free_gpu_mem_fraction"
  value: {
    string_value: "0.85"
  }
}
parameters: {
  key: "enable_trt_overlap"
  value: {
    string_value: "True"
  }
}

prepare the msg data
data.json
run the test cmd
(by apache2-utils)

ab -c 4 -n 4 -p data.json localhost:8000/v2/models/ensemble/generate

error msg

[TensorRT-LLM][ERROR] Encountered an error in forward function: [TensorRT-LLM][ERROR] CUDA runtime error in ::cudaEventSynchronize(get()): an illegal memory access was encountered (/app/tensorrt_llm/cpp/include/tensorrt_llm/runtime/cudaEvent.h:66)
1       0x7f155e81e045 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x36045) [0x7f155e81e045]
2       0x7f155e87fa8a /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x97a8a) [0x7f155e87fa8a]
3       0x7f155e84c821 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x64821) [0x7f155e84c821]
4       0x7f155e8515c7 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x695c7) [0x7f155e8515c7]
5       0x7f155e83b241 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x53241) [0x7f155e83b241]
6       0x7f155e83c38a /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x5438a) [0x7f155e83c38a]
7       0x7f16df264253 /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc253) [0x7f16df264253]
8       0x7f16deff4ac3 /usr/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x7f16deff4ac3]
9       0x7f16df085bf4 clone + 68
[TensorRT-LLM][ERROR] Encountered error for requestId<PHONE_NUMBER>: Encountered an error in forward function: [TensorRT-LLM][ERROR] CUDA runtime error in ::cudaEventSynchronize(get()): an illegal memory access was encountered (/app/tensorrt_llm/cpp/include/tensorrt_llm/runtime/cudaEvent.h:66)
1       0x7f155e81e045 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x36045) [0x7f155e81e045]
2       0x7f155e87fa8a /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x97a8a) [0x7f155e87fa8a]
3       0x7f155e84c821 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x64821) [0x7f155e84c821]
4       0x7f155e8515c7 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x695c7) [0x7f155e8515c7]
5       0x7f155e83b241 /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x53241) [0x7f155e83b241]
6       0x7f155e83c38a /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so(+0x5438a) [0x7f155e83c38a]
7       0x7f16df264253 /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc253) [0x7f16df264253]
8       0x7f16deff4ac3 /usr/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x7f16deff4ac3]
9       0x7f16df085bf4 clone + 68
[TensorRT-LLM][ERROR] Encountered error for requestId<PHONE_NUMBER>: Encountered an error in forward function: [TensorRT-LLM][ERROR] CUDA runtime error in ::cudaEventSynchronize(get()): an illegal memory access was encountered (/app/tensorrt_llm/cpp/include/tensorrt_llm/runtime/cudaEvent.h:66)
...

@byshiue I seems to be success if I switch of the inflight batch (build without --use_inflight_batching and config triton)

@byshiue ，hi，have you replicated it according to col-in-coding's steps ?

I try to reproduce this issue by your config, and that results I get
bhsueh@75653932fc7c:/home/scratch.bhsueh_sw_1/workspace/TensorRT-LLM/tllm_backend_nvbug$ I1121 07:22:22.905217 1241 pinned_memory_manager.cc:241] Pinned memory pool is created at '0x7f1c48000000' with size 268435456
I1121 07:22:22.908173 1241 cuda_memory_manager.cc:107] CUDA memory pool is created on device 0 with size 67108864
I1121 07:22:22.971625 1241 model_lifecycle.cc:461] loading: preprocessing:1
I1121 07:22:22.972690 1241 model_lifecycle.cc:461] loading: tensorrt_llm:1
I1121 07:22:22.973734 1241 model_lifecycle.cc:461] loading: postprocessing:1
[TensorRT-LLM][WARNING] Parameter max_draft_len cannot be read from json:
[TensorRT-LLM][WARNING] [json.exception.out_of_range.403] key 'max_draft_len' not found
[TensorRT-LLM][WARNING] [json.exception.type_error.302] type must be number, but is null
[TensorRT-LLM][WARNING] Optional value for parameter max_num_tokens will not be set.

[TensorRT-LLM][WARNING] max_num_sequences is smaller than  2 times the engine max_batch_size. Batches smaller than max_batch_size will be executed.
I1121 07:22:25.718881 1241 model_lifecycle.cc:818] successfully loaded 'tensorrt_llm'
I1121 07:22:25.720711 1241 model_lifecycle.cc:461] loading: ensemble:1
I1121 07:22:25.721117 1241 model_lifecycle.cc:818] successfully loaded 'ensemble'
I1121 07:22:25.721209 1241 server.cc:592]
+------------------+------+
| Repository Agent | Path |
+------------------+------+
+------------------+------+

I1121 07:22:25.721291 1241 server.cc:619]
+-------------+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| Backend     | Path                                                            | Config                                                                                |
+-------------+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| python      | /opt/tritonserver/backends/python/libtriton_python.so           | {"cmdline":{"auto-complete-config":"true","backend-directory":"/opt/tritonserver/backends","min-compute-capability":"6.000000","default-max |
|             |                                                                 | -batch-size":"4"}}                                                                                |
| tensorrtllm | /opt/tritonserver/backends/tensorrtllm/libtriton_tensorrtllm.so | {"cmdline":{"auto-complete-config":"true","backend-directory":"/opt/tritonserver/backends","min-compute-capability":"6.000000","default-max |
|             |                                                                 | -batch-size":"4"}}                                                                                |
+-------------+-----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+

I1121 07:22:25.721355 1241 server.cc:662]
+----------------+---------+--------+
| Model          | Version | Status |
+----------------+---------+--------+
| ensemble       | 1       | READY  |
| postprocessing | 1       | READY  |
| preprocessing  | 1       | READY  |
| tensorrt_llm   | 1       | READY  |
+----------------+---------+--------+

I1121 07:22:25.760708 1241 metrics.cc:817] Collecting metrics for GPU 0: NVIDIA H100 NVL
I1121 07:22:25.760858 1241 metrics.cc:710] Collecting CPU metrics
I1121 07:22:25.760946 1241 tritonserver.cc:2458]
+----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Option                           | Value                                                                                |
+----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| server_id                        | triton                                                                                |
| server_version                   | 2.39.0                                                                                |
| server_extensions                | classification sequence model_repository model_repository(unload_dependents) schedule_policy model_configuration system_shared_memory cuda_shared_memory binary_tensor_data parameters s |
|                                  | tatistics trace logging                                                                                |
| model_repository_path[0]         | all_models/inflight_batcher_llm/                                                                                |
| model_control_mode               | MODE_NONE                                                                                |
| strict_model_config              | 0                                                                                |
| rate_limit                       | OFF                                                                                |
| pinned_memory_pool_byte_size     | 268435456                                                                                |
| cuda_memory_pool_byte_size{0}    | 67108864                                                                                |
| min_supported_compute_capability | 6.0                                                                                |
| strict_readiness                 | 1                                                                                |
| exit_timeout                     | 30                                                                                |
| cache_enabled                    | 0                                                                                |
+----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

I1121 07:22:25.764392 1241 grpc_server.cc:2513] Started GRPCInferenceService at <IP_ADDRESS>:8001
I1121 07:22:25.764549 1241 http_server.cc:4497] Started HTTPService at <IP_ADDRESS>:8000
I1121 07:22:25.805388 1241 http_server.cc:270] Started Metrics Service at <IP_ADDRESS>:8002

bhsueh@75653932fc7c:/home/scratch.bhsueh_sw_1/workspace/TensorRT-LLM/tllm_backend_nvbug$ wget https://github.com/triton-inference-server/tensorrtllm_backend/files/13236039/data.json
--2023-11-21 07:22:39--  https://github.com/triton-inference-server/tensorrtllm_backend/files/13236039/data.json
Resolving github.com (github.com)... <IP_ADDRESS>
Connecting to github.com (github.com)|<IP_ADDRESS>|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-repository-file-5c1aeb/690665848/13236039?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231121%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231121T072239Z&X-Amz-Expires=300&X-Amz-Signature=b2524a4618993a56a867efaf05d7cb9331c2393f4e3aa3986c45e613eb19a717&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=690665848&response-content-disposition=attachment%3Bfilename%3Ddata.json&response-content-type=application%2Fjson [following]
--2023-11-21 07:22:40--  https://objects.githubusercontent.com/github-production-repository-file-5c1aeb/690665848/13236039?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20231121%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231121T072239Z&X-Amz-Expires=300&X-Amz-Signature=b2524a4618993a56a867efaf05d7cb9331c2393f4e3aa3986c45e613eb19a717&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=690665848&response-content-disposition=attachment%3Bfilename%3Ddata.json&response-content-type=application%2Fjson
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|<IP_ADDRESS>|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8347 (8.2K) [application/json]
Saving to: 'data.json'

data.json                                               100%[==============================================================================================================================>]   8.15K  --.-KB/s    in 0.004s

2023-11-21 07:22:40 (1.97 MB/s) - 'data.json' saved [8347/8347]

bhsueh@75653932fc7c:/home/scratch.bhsueh_sw_1/workspace/TensorRT-LLM/tllm_backend_nvbug$ sudo apt-get install apache2-utils
[sudo] password for bhsueh:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libapr1 libaprutil1
The following NEW packages will be installed:
  apache2-utils libapr1 libaprutil1
0 upgraded, 3 newly installed, 0 to remove and 33 not upgraded.
Need to get 290 kB of archives.
After this operation, 992 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libapr1 amd64 1.7.0-8ubuntu<IP_ADDRESS> [108 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 libaprutil1 amd64 1.6.1-5ubuntu<IP_ADDRESS> [92.8 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 apache2-utils amd64 2.4.52-1ubuntu4.6 [89.1 kB]
Fetched 290 kB in 1s (263 kB/s)
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78, <> line 3.)
debconf: falling back to frontend: Readline
Selecting previously unselected package libapr1:amd64.
(Reading database ... 25870 files and directories currently installed.)
Preparing to unpack .../libapr1_1.7.0-8ubuntu<IP_ADDRESS>_amd64.deb ...
Unpacking libapr1:amd64 (1.7.0-8ubuntu<IP_ADDRESS>) ...
Selecting previously unselected package libaprutil1:amd64.
Preparing to unpack .../libaprutil1_1.6.1-5ubuntu<IP_ADDRESS>_amd64.deb ...
Unpacking libaprutil1:amd64 (1.6.1-5ubuntu<IP_ADDRESS>) ...
Selecting previously unselected package apache2-utils.
Preparing to unpack .../apache2-utils_2.4.52-1ubuntu4.6_amd64.deb ...
Unpacking apache2-utils (2.4.52-1ubuntu4.6) ...
Setting up libapr1:amd64 (1.7.0-8ubuntu<IP_ADDRESS>) ...
Setting up libaprutil1:amd64 (1.6.1-5ubuntu<IP_ADDRESS>) ...
Setting up apache2-utils (2.4.52-1ubuntu4.6) ...
Processing triggers for libc-bin (2.35-0ubuntu3.3) ...
bhsueh@75653932fc7c:/home/scratch.bhsueh_sw_1/workspace/TensorRT-LLM/tllm_backend_nvbug$ ab -c 4 -n 4 -p data.json localhost:8000/v2/models/ensemble/generate
This is ApacheBench, Version 2.3 <$Revision: 1879490 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient).....done

Server Software:
Server Hostname:        localhost
Server Port:            8000

Document Path:          /v2/models/ensemble/generate
Document Length:        9828 bytes

Concurrency Level:      4
Time taken for tests:   5.787 seconds
Complete requests:      4
Failed requests:        2
   (Connect: 0, Receive: 0, Length: 2, Exceptions: 0)
Total transferred:      39790 bytes
Total body sent:        34020
HTML transferred:       39346 bytes
Requests per second:    0.69 [#/sec] (mean)
Time per request:       5786.643 [ms] (mean)
Time per request:       1446.661 [ms] (mean, across all concurrent requests)
Transfer rate:          6.72 [Kbytes/sec] received
                        5.74 kb/s sent
                        12.46 kb/s total

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:  1772 2800 923.1   2775    4014
Waiting:     1772 2800 923.2   2774    4014
Total:       1772 2800 923.1   2775    4014

Percentage of the requests served within a certain time (ms)
  50%   2775
  66%   2775
  75%   4014
  80%   4014
  90%   4014
  95%   4014
  98%   4014
  99%   4014
 100%   4014 (longest request)

Will continue investigating when I have bandwidth.

Any updates? Has the problem been solved?

Any updates? Has the problem been solved?

Hi @zhaocc1106
Change enable_trt_overlap to False seems work for me. You can have a try :)

Any updates? Has the problem been solved?

Hi @zhaocc1106 Change enable_trt_overlap to False seems work for me. You can have a try :)

Thanks very much!!!

This just fixed the same issue for me!  Thank you!
What is the intuition on why this worked?


Solve crashes when dependency calculation takes more than 1 second with ruby solver

Solve 2 crashes when resolution takes more than 1 second with ruby solver. Molinillo calls ui to update UI every 1 second.
This is the stacktrace:
/home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/gems/molinillo-0.2.3/lib/molinillo/resolution.rb:293:in `indicate_progress': undefined method `indicate_progress' for #<Solve:
:RubySolver:0x007f28b91fa408> (NoMethodError)
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/gems/molinillo-0.2.3/lib/molinillo/resolution.rb:63:in `resolve'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/gems/molinillo-0.2.3/lib/molinillo/resolver.rb:40:in `resolve'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/gems/solve-2.0.1/lib/solve/ruby_solver.rb:177:in `resolve_with_error_wrapping'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/gems/solve-2.0.1/lib/solve/ruby_solver.rb:72:in `resolve'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/gems/solve-2.0.1/lib/solve.rb:64:in `it!'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/bundler/gems/berkshelf-c7bd4b19cc11/lib/berkshelf/resolver.rb:76:in `resolve'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/bundler/gems/berkshelf-c7bd4b19cc11/lib/berkshelf/installer.rb:175:in `install_from_universe'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/bundler/gems/berkshelf-c7bd4b19cc11/lib/berkshelf/installer.rb:39:in `run'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/bundler/gems/berkshelf-c7bd4b19cc11/lib/berkshelf/berksfile.rb:374:in `install'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/bundler/gems/berkshelf-c7bd4b19cc11/lib/berkshelf/berksfile.rb:399:in `update'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/bundler/gems/berkshelf-c7bd4b19cc11/lib/berkshelf/cli.rb:163:in `update'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/bundler/gems/berkshelf-c7bd4b19cc11/lib/berkshelf/cli.rb:52:in `dispatch'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/bundler/gems/berkshelf-c7bd4b19cc11/lib/berkshelf/cli.rb:27:in `execute!'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/bundler/gems/berkshelf-c7bd4b19cc11/bin/berks:5:in `<top (required)>'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/bin/berks:23:in `load'
        from /home/vagrant/code/platform/infra/vendor/bundle/ruby/2.2.0/bin/berks:23:in `<main>'

@josacar thanks for the bug report, this should be an easy fix

Yes, adding the method solves the crash, I didn't submit a PR as it's new behavior and I didn't know what to implement. I can submit a PR if you tell me the implementation, maybe is as easy as:
def indicate_progress
  print '.'
end

@josacar I think the easiest fix is just to no-op the callback function. We aren't using it and didn't intend for it to be called in the first place

PR submitted with no-op


webpack-hud

webpack-hud is a very useful webpack plugin which displays eslint errors and warnings directly on the web page. Is there any equivalent with fuse-box ?

This is being worked on in the error-loggin branch see #759

Like @calebboyd said, this will be coming in 2.2.4


Use Collateral instead of SignedTcbInfo for Evidence

The Evidence wrapper now takes the mc-sgx-dcap-types::Collateral
instead of the SignedTcbInfo in the new() method. This is to allow
deriving the QE identity and other necessary fields from the
Collateral.
Motivation
This is a first step in getting all of the data needed to verify a quote in one place. At this time it just replaces the tcb info.
The plan is to also add in getting the qe_identity from the collateral and verifying it.
Some things still being flushed out
Mbedtls works in the enclaves, but has been a thorn for other clients, so we want to make it easier for clients to provide alternative implementations. I'm calling that the CertChainVerifier. With that in mind, my current understanding of the inputs needed to the final verification object is:
flowchart LR
    Q(Quote) --> E[Evidence]
    C(Collateral) --> E
    E --> V[Verifier]
    T[Trust Roots] --> V
    S[Time] --> V
    CT[CertChainVerfier] --> V
    M[Measurements] --> V

I think we can move the Trust Roots be internal to the CertChainVerifier. The Time is needed for verifying the QeIdentity and TcbInfo.
For the measurements, I'm thinking we'll want to move, or mimic, the new types from the MobileCoin repo into this repo, https://github.com/mobilecoinfoundation/mobilecoin/pull/3369.

Current dependencies on/for this PR:

main

PR #120   👈

This comment was auto-generated by Graphite.

@nick-mobilecoin merged this pull request with Graphite.


Create SRD for FHIR Translation Feature

User Story

As the Universal Pipeline,
My steps should follow the single-responsibility principle (in other words, the steps should be cohesive),
so that I can reduce the complexity of the system, make it easier to configure and maintain, and make it easier to keep the implementation DRY.
Description/Use Case

Presently, the Route step (ReceiverFilterFunction) has filters that also modify bundles. This is bad design as it makes the possibility of defects higher and makes the system harder to use and understand. Instead, routing filter's sole responsibility shall be to determine if a bundle contains the necessary information a particular receiver is asking for. ReportStream presently has the ability to modify bundles via FHIR-FHIR transforms, and this should be the only place bundles are modified.
The high-level proposal that should be documented as an SRD is:

Add a new step between DestinationFilterFunction and ReceiverFilterFunction that shall apply one or more FHIR transforms to a bundle

This will require adding new functionality to FHIR-FHIR transforms, like the ability to remove one or more resources

Remove MappedConditionFilter
Redesign Receiver Routing Filters: squish all the receiver filters into a single FHIR expression Filter that can be instantiated as many times as the user would like. This can exist in parallel with the existing system as to not force engagement to perform a migration.

Risks/Impacts/Considerations

Dev Notes

Acceptance Criteria

[ ] SRD Created
[ ] Approval from Engagement team (Chris and Victor)

Hey team! Please add your planning poker estimate with Zenhub @adegolier @arnejduranovic @brick-green @david-navapbc @jack-h-wang @jalbinson @JFisk42 @mkalish @thetaurean

Hey team! Please add your planning poker estimate with Zenhub @adegolier @brick-green

Before we do this, we'd like more info on what features are missing or needed for engagement to migrate to relying on FHIR->FHIR transforms for data-related enrichments. @chris-kuryak. It does not make much sense to proceed with this work until we have that AND a commitment to migrate data enrichments to FHIR->FHIR transforms. @chris-kuryak @Andrey-Glazkv @brandonnava

Please add your planning poker estimate with Zenhub @jalbinson

SRD approved by @victor-chaparro


Update water volume shader

This replaces the water volume PrincipledBSDFShader with a Volume Absorption and Volume Scattering shader to provide a better representation of light attenuation in water.   The scattering shader can be updated with Blender 4.3 to use the phase 'Fournier-Forand' which models scattering in an underwater environment (commented out in water.py). The combination of Volume Absorption and Volume Scattering shaders is based on this post https://blender.stackexchange.com/questions/129220/how-to-create-an-underwater-scene-in-cycles
Example image from coral_reef.gin scene

Thanks for the contribution!
I agree the water shader could use some work.
It seems this PR has gotten tangled with the other changes. would it be possible to cherrypick this out into an isolated branch?
The other thing that would be mildly useful is to make this an additional independent option for the water shader, rather than replacing the original. IE could you create a new file altogether called water_scatter.py or something similar? this would be maximally safe.


Issue generating descriptors for DiscoveryServices Model

Issue and tracking information
Developer's time Estimated effort to fix (hours):
Developer's Actual time spent on fix (hours)
Issue reporter to provide a detailed description of the issue in the space below
When attempting to generate descriptors for the DiscoveryServices model (which you should have access to), we get an exception. This is in the later CX release (not an old maintenance branch). The exception is:
eclipse.buildId=unknown
java.version=11.0.18
java.vendor=Red Hat, Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64
This is a continuation of log file /home/entds.ngisn.com/4j26151/workspaces/SNA_Opendds/.metadata/.bak_1.log
Created Time: 2023-05-08 09:43:38.864
org.apache.log4j
Error
Mon May 08 10:01:47 EDT 2023
com.zeligsoft.base.zdl.oaw.ZXtendGenerator  - Error in Component generator of type com.zeligsoft.base.zdl.oaw.ZXtendGenerator:
EvaluationException : class org.eclipse.uml2.uml.internal.impl.ComponentImpl cannot be cast to class org.eclipse.uml2.uml.Property (org.eclipse.uml2.uml.internal.impl.ComponentImpl and org.eclipse.uml2.uml.Property are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @70cf0381)
template::mainTransformAxcioma.ext[24178,208] on line 436 'DeploymentPart getPerPortDP(DeploymentPart part,DataSpace dataSpace)'
template::mainTransformAxcioma.ext[23175,31] on line 417 '.getPerPortDP(source,dataSpace)'
template::mainTransformAxcioma.ext[21916,82] on line 401 '.createDDS4CCMConnectorFragmentHelper(source,target,plan,deployment,dataSpace)'
template::mainTransformAxcioma.ext[20716,202] on line 382 'dt.deployed.select(dep|dep.modelElement==compPart).select(part|part.hasAncestor(origConnPart)).createDDS4CCMConnectorFragmentHelper(dt.deployedOn,plan,deployment,dataSpace,compPort,origConn)'
template::mainTransformAxcioma.ext[19511,73] on line 367 '.visit(connector,dataSpace,plan,deployment,expansionObject,connector)'
template::mainTransformAxcioma.ext[19227,128] on line 364 'assembly.connector.select(c|c.end.zdlAsConnectorEnd().role.contains(dataSpace)).visit(dataSpace,plan,deployment,dataSpace)'
template::mainTransformAxcioma.ext[19013,72] on line 361 '.visit(dataSpace,plan,deployment,dataSpace.zdlAsProperty().eContainer)'
template::mainTransformAxcioma.ext[3571,44] on line 66 'connectors.createInstances(plan,deployment)'
template::mainTransformDispatcher.ext[1280,33] on line 37 'deployment.mainTransformAxcioma()'
nofile[0,32] on line 1 '.mainTransformDispatcher(element)'

Hi. I only see the .emx file for DiscoveryServices in the cx-reproducers repo. Do you have the Papyrus version?

Whoops, my bad. I just pushed up our latest Discovery Services example in the cx-reproducers under /bug/445

Hi. When upening the model I get an error with an unresolved package import: pathmap://DISCOVERY_CONNECTORS_LIBRARY/models/CCM_Discovery.uml#_iSq60Zh1EeGMaJIogGfUbQ. This looks like it's your own library. Could you add the library as well?
Thanks

Just to give you a quick update. The problem seems related to the fact that there are some ports in the model that are not connected, namely DiscoverServices::customer_A::restaurantServicesRecept (and similarly for customer_B). In fact the same error pops-up when you are in the deployment editor and select any of these ports. The exception comes from the same function which we overhauled when dealing with Issue #428.
I'm trying to understand what should be the behaviour in both cases: when generating descriptors, and when displaying the properties in the deployment editor.

Thank you for the update. Although it isn't used much now, we have always tried to support the scenario where CORBA4CCM facet/receptacles are allowed to not have matching sides at deployment time. I believe we have other model examples with non-connected facets and receptacles in models that don't have this issue, but it is possible that those ports are marked "local" only, or some other small difference to this scenario.

I understand. It should work even if ports are not connected.
A bit more info that narrows it down: the problem during generation occurs when you have an assembly that has at least one non-connected port and at least one connector. So it's possible that your other examples that work have a non-connected port but no connector in the same assembly.
The exception occurs in the display of the properties of an unconnected port when selecting it from the deployment editor, regardless of whether there are connectors or not. But the reason in both cases is the same.
I'm working on a solution now.

The PR solves the issue. You can get a build to test here.
Let me know if that works for you.

I was able to test this out on my end. The descriptor generated and I was able to deploy with the generated CDP file. Thank you!

Great! If there are no objections, I'll merge it and close this one.

Sounds good to me

Closing.

@eposse Would we be able to get the fix that was made here applied to the 2.3.0 papyrus maintenance branch? From what I can tell from the PR, it looks fairly small and trivial to back port? We have a team that is stuck using the 2.3.0 papyrus release for another 5-8 months and this issue is biting them pretty frequently.

It looks like it may be doable. One thing though is that I’ll be leaving on vacations this Friday and I’ll be back the 20th, and unfortunately I won’t have my laptop with me. So I imagine this should have priority over #443, right? I will try to port it by tomorrow.

Yes, since this should be a relatively short task, we would want you to prioritize this port over #443. Thank you

Ok, I've ported it. A couple of comments:

I forgot to create a separate branch so I pushed it directly to streams/v2.3.0-maintenance.
The build succeeds and works as expected. No exceptions in either code generation nor selecting unconnected ports and showing the Properties > CX view in the Deployment Editor.
Porting back also includes other changes in the generation that were introduced later, in particular, using qualified names instead of UUIDs for identifiers. I'm not sure yet which other changes from 2.4 and 2.5 might have gone in. That won't be a problem, will it?
The version built is 2.3.1. Is that the right one or did we already released a 2.3.1?

As I mentioned, I'm leaving on vacations on Friday, and in fact I will leave a little earlier tomorrow (Thursday), so can you test it on your end and let me know if there are any issues?
Also, I'm not sure how to do the release, as we normally only publish the new ones, not the maintenance ones. Or do you prepare your own internal release from the maintenance branch?

I have verified it on my end though, so I think we are all set on this issue for now.

Thanks.
To answer your previous question, I cherry-picked commit a4dcdb3b8e6db7b2425aa84dfc17ae6213f6247e, which was used to solve this issue originally. That commit was made just before the 2.4.0 release.
I had to resolve a couple of conflicts, but the functionality that replaced UUIDs with qualified names was there. I'm tracking down where exactly it was added, but I think it was that same commit.

I found that the replacement of UUIDs with qualified names was done in commit 083d472156929f245d8c518aaa5a89a24a6e3323, and it was Issue #408 (PR #438). This was the last commit before the 2.3.0 tag, and before commit a4dcdb3b8e6db7b2425aa84dfc17ae6213f6247e (the one solving this issue), so it should have been already in the 2.3.0 release. However, when I tested that release yesterday, it showed UUIDs instead of qualifier names, so I'm not sure what happened there.

I figured out what happened. The change to replace UUIDs with qualified names was included in 2.3.0, but when I tested 2.3.0 yesterday, I did a compare of the DiscoveryServices model descriptors from the cx-reproducers repo, before and after generating descriptors, but the one in the cx-reproducers repo already included descriptors generated with 2.2.0 that still had UUIDs. So I was actually comparing 2.3.0 descriptors against 2.2.0 descriptors. I incorrectly concluded that 2.3.0 was still generating UUIDs instead of qualified names.
So all is good.

Great! So can we close this again?

Yes we can


Add note styles on track slider

Hi guys. I wanna add note on track of slider like this image below. Please help me! Thanks you!

Hi, You can fork lib, add this.


Utils for tagging stages

This PR implements the code for tagging stages, adding some utils function for getting and tagging with the index (or the computed profile) of the current running stage.
It requires an xk6 build of https://github.com/grafana/k6/pull/2493 for running the tests.
$ xk6 build master
$ ./k6 run tests/stages.js

Added some more edge cases, and applied more refactor for making the code a bit more readable. Let me know if you have better ideas for having a better code for parseDuration. It would be good to keep at least O(N) considering the amount of time it could be invoked during a test.

Cool to see "unit tests" using k6chaijs! :tada:


Dispatch install.sh fails: Service 'web' failed to build

Hi,
When I run install.sh it fails with the following error:
...
Step 10/43 : RUN for key in     B42F6819007F00F88E364FD4036A9C25BF357DD4     595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7     94AE36675C464D64BAFA68DD7434390BDBE9B9C5     FD3A5288F042B6850C66B31F09FE44734EB7990E     71DCFD284A79C3B38668286BC97EC7A07EDE3FC1     DD8F2338BAE7501E3DD5AC78C273792F7D83545D     C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8     B9AE9905FFD7803F25714661B63B535A4C206CA9     77984A986EBC2AA786BC0F66B01FBB92821C587A     8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600     4ED778F539E3634C779C87C6D7062848A1AB005C     A48C2BEE680E841632CD4E44F07496B3EB3C1762     B9E2F5981AA6E0CD28160D9FF13993A75599653C     ; do     gpg --batch --keyserver hkps://mattrobenolt-keyserver.global.ssl.fastly.net:443 --recv-keys "$key";     done
 ---> Running in 5b7fc432e312
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: keyserver receive failed: Server indicated a failure
gpg: keyserver receive failed: Server indicated a failure
...
gpg: keyserver receive failed: Server indicated a failure
Removing intermediate container 5b7fc432e312
ERROR: Service 'web' failed to build: The command '/bin/sh -c for key in...

Running on KDE neon User Edition 5.18 (18.04), Docker version 19.03.7 and docker-compose version 1.25.4.

@karymau hmm... seems like a problem with the PGP keyserver (hkps://mattrobenolt-keyserver.global.ssl.fastly.net) than Dispatch: gpg: keyserver receive failed: Server indicated a failure. Can you try again with a different keyserver?
In the future, please report issues with Dispatch docker here: https://github.com/Netflix/dispatch-docker

Can you try again with a different keyserver?

Yes, of course, but could you please advise how to do it?

The issue could be dirmngr and/ or DNS related: https://unix.stackexchange.com/questions/399027/gpg-keyserver-receive-failed-server-indicated-a-failure
Good luck!


Give More Exposure to Announcements

Subject of the issue
The "Announcement section" in the Home page  needs to be given more exposure.
Rather than listing it among the other sections in the Home page, would be better if displayed on top of the page as a badge or using some highlighter.
And within the Announcement page , the each  announcement listing could be given a heading ,or use some hashtags on top (for eg: #Ernakulam #relief camps, etc) ,add  social media  share buttons for easy sharing of messages. The priority levels (coloring code) marked could also be improved , cant figure out it for a layman user. Right now, its hardly noticeable.

I will work on the issue.

@Aswinpookkatt  Do you need help with this?

@abhiramr sure any help is welcome.

@Aswinpookkatt  Can you ping me on the Slack group? - Abhiram Ramesh

am at slack now. do you want any help over that?

@Aswinpookkatt I can add a noticeable header banner in the home page. Meanwhile you can work on the tags and stuff ?

Is this done or still waiting for more testing before merge?

@mankidavu #1022 & #1023 fixes a part of the issue. More work needs to be done for fixing this.

As this is a top priority item, can we get few more volunteers with necessary skills to fix it quickly and merge?

@mankidavu @abhiramr is working on it at the moment (the tags for each announcement)

@mankidavu Working on tags right now. Will ask asap if extra hands are needed.
It will help if you can provide more info on what sort of announcements are required in addition to what the above two PRs have + description in this issue?
WRT

lots of rumours floating around on my school and college groups. Like minor landslides with no causalities. People stuck ,but safe and waiting for water to recede etc.

Any thoughts on how this can be announced better?

...

WRT

lots of rumours floating around on my school and college groups. Like minor landslides with no causalities. People stuck ,but safe and waiting for water to recede etc.

Any thoughts on how this can be announced better?

Earlier today I saw a gif file created by someone indicating the excess waterflow towards CIAL airport. It happened almost exactly as it is at a later stage. I'm sure we can create such 3D models over map data easily and make a simple gif file. That will make people understand it better, once shared through our announcement area. Let me dig that particular gif.

A dedicated team has to be assigned to contact the kseb officials inorder to confirm the opening of dams and they should be able to report us through a online tab there by it could be added to the announcement area inorder to reduce the fake news

The PR https://github.com/IEEEKeralaSection/rescuekerala/pull/1022/commits/4650f7dd0d5537428d7f8a314851e044e8267b9c
now has code for Hashtags as well.
Comments with GIFs here - https://github.com/IEEEKeralaSection/rescuekerala/pull/1022


Add a db_json in the enum

As more and more databases are adding a json type, is it possible to add a db_json in the enum ?
Originally posted by @Sildra in https://github.com/SOCI/soci/issues/954#issuecomment-1772517143

@Sildra Let's discuss separate things in their own issues.
FWIW it should, of course, be possible to add support for JSON, probably just mirroring the existing support for XML.


[Doc] Reduce links

Reduces links in the docs. We have been adding links every time we mention the phrases INSERT INTO, CREATE TABLE, Routine Load, etc. This is not necessary in general, and if the reader wants to get more information on any of these they can just use search in the top nav.
What type of PR is this:

[ ] BugFix
[ ] Feature
[ ] Enhancement
[ ] Refactor
[ ] UT
[x] Doc
[ ] Tool

Does this PR entail a change in behavior?

[ ] Yes, this PR will result in a change in behavior.
[x] No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

[ ] Interface/UI changes: syntax, type conversion, expression evaluation, display information
[ ] Parameter changes: default values, similar parameters but with different default values
[ ] Policy changes: use new policy to replace old one, functionality automatically enabled
[ ] Feature removed
[ ] Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

[ ] I have added test cases for my bug fix or my new feature
[ ] This pr needs user documentation (for new or modified features or behaviors)

[ ] I have added documentation for my new feature or new function

[ ] This is a backport pr

Bugfix cherry-pick branch check:

[x] I have checked the version labels which the pr will be auto-backported to the target branch

[x] 3.3
[x] 3.2
[x] 3.1
[ ] 3.0
[ ] 2.5

@mergify rebase


Naive Bayes Agent

Naive Bayes machine learning agent: Provides an agent front end to the NBayes gem: "NBayes is a full-featured, Ruby implementation of Naive Bayes". The agent takes events from some sources as training data and then classifies other events based on that data. A field in the event payload is analyzed and another is populated with the categories. Then the event is emitted. Training data is stored in the agent's memory.
As I don't know Ruby, everything looks like it is working, but that is just from a few of my preliminary tests working, so any and all feedback is more than welcome.

Hey @nogre, welcome!

I'm building a sort of google-news-esque site that aggregates blog posts called The Practical Ontologist. So I use a lot of RSS agents and then format the output. Then take all the output and build the site with Jekyll.  more on how it works
What I want to do is be able to have different sections instead of a single page, as it is right now. So, if I can figure out how to get things working/ trained well, this agent will classify and tag different posts. Then I'll have sub-pages that focus on specific topics.

exists as gem: https://github.com/nogre/huginn_naive_bayes_agent

Nice!


Add Italian Language

Add Italian Language as "it.ts" at musescore-downloader/src/i18n

Thank you!

Thank you!

In order to make this work, it must be added to the locales list
src/i18n/index.ts
import it from './it'

// ...

const locales = (<L extends { [n: string]: LOCALE } /** type checking */> (l: L) => Object.freeze(l))({
  en,
  es,
  it,
})

In order to make this work, it must be added to the locales list
src/i18n/index.ts
import it from './it'

// ...

const locales = (<L extends { [n: string]: LOCALE } /** type checking */> (l: L) => Object.freeze(l))({
  en,
  es,
  it,
})

Oops

Oops


Interacting with the user

added funcs like alert and prompt in index.js

Okay, I thought it would be fun.


Why this plugin?

I thought of using obsidian as a markdown editor for my blog. Have faced problem in handing tags, links and images.
Solved tags using a bash script.
Then I search for plugin support for wikilinks. I found this and pelican-obsidian
This plugin also gave credit to that.
If that plugin solves the purpose, what is this plugin solves? Just want to know.

Hi @arulrajnet!
This plugin is part of my effort to create a Pelican site with a base of my Obsidian vault. jonathan-s' plugin extends the default Markdown reader to add processing for Wiki-style links. This plugin, however, is not part of the reader, and so you can use this plugin alone, and with a reader of your choice.
I've also made a CommonMark reader (minchin.pelican.readers.commonmark), and the two pair well together when working with an Obsidian vault.
Why separate? It's easier for me to solve smaller problems, so this way I could solve the problem of wikilinks, and later solve the problem of CommonMark (which is just slightly different from the default Python Markdown....).
Hope this makes sense. Feel free to propose improvements to the plugin's readme to help other understand too. And let me know if you run into issues using this!


Allow function to be passed to MockContract#mock.<contractFunction>.returns

If we were to allow an (optionally async) function to be passed to MockContract#mock.<contractFunction>.returns and MockContract#mock.<contractFunction>.withArgs(...).returns, then we could mock any side-effects that calling that contract function would normally cause. My proposed signature would be:
(contract: MockContract) => Promise<any> | any

where contract is the mocked contract, and the returned (promise-resolved) value is passed as the contract function's mocked value.
My use-case: I'm testing a contract that interacts with a Compound ERC20 (CERC20). When my contract calls redeemUnderlying on this CERC20, I have to separately update the mocked value of balanceOf and also call the underlying mocked ERC20 to send tokens to my contract. It would be nice to be able to define these actions this way, as it would

be more semantically clear that these are side-effects of calling the contract method
execute the actions in the correct order, since the actions would run before returning the mocked value

To show an example of what this would look like (using Hardhat + Typescript):
export async function deployMockContract(deployer: Signer, anotherMock: MockContract): Promise<MockContract> {
  const artifact: Artifact = await hre.artifacts.readArtifact('ContractToMock')
  const mockContract: MockContract = await hre.waffle.deployMockContract(deployer, artifact)
  await mockContract.mock.doThingWithSideEffects.returns(async (contract: MockContract) => {
    // update getter for state var
    await contract.mock.someStateVar.returns('new affected value')
    // update another affected mock contract
    await anotherMock.mock.someValue.returns('affected by other contract')
    return 'this is a mocked return value'
  })
  return mockContract
}

I am able and willing to contribute to writing this feature if maintainers would be open to its inclusion.

Hey @flux627
Sorry it took some time to get back to you.
Is this still a feature request you're looking for?
Or did you find a different means to achieve your goal?
We're open to collaborate on this one.

I don't remember the exact context I needed this when posting, however I still think this feature would be useful.


Add option to autoscroll Paragraph when appending text

Hey,
I noticed there doesn't seem to be any kind of autoscroll feature when inserting new text with par.Text += "Text\n" and it is at the bottom. It would be nice to have this boolean available.
Also, it doesn't seem to be possible to not wrap text inside the par (when using the layout at least). Meaning, text will wrap as you decrease the width. This works fine with lists though.
Thanks

Any update to the auto scroll ?


feat: implemented API for checking version with local registry

This PR implements the API for comparing the versions of the local registry and checking if the latest version is already there or not.

Thanks.


Add more details on using Results in WhenExpressions

Changes

Add more information to the docs about using Results in WhenExpressions.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:

[x] Includes tests (if functionality changed/added)
[x] Includes docs (if user facing)
[x] Commit messages follow commit message best practices
[x] Release notes block has been filled in or deleted (only if no user facing changes)

See the contribution guide for more details.
Double check this list of stuff that's easy to miss:

If you are adding a new binary/image to the cmd dir, please update
the release Task to build and release this image.

Reviewer Notes
If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.
Release Notes
    NONE

/lgtm
Looking Good! 🤙🏽

/test check-pr-has-kind-label

/test check-pr-has-kind-label

thanks @jerop
/approve


Loaded execution plan is not shown if there is no resultsets in SQL Editor

System information:

DBeaver version 22.0.1

Steps to reproduce, if exist:

Save an execution plan
Close all result tabs in SQL Editor
In context menu select Load Execution plan

Expected: Execution plan tab is opened
Actual: Looks like nothing happened, but executing a select after that will open both the resultset and previously loaded execution plan

Duplicate #15375


Opening of an exported diagram is empty

Try to open the exported diagram with the option "Files -> Open with -> Yang Diagram" ==> open an editor which does not show the diagram at all.

I guess this is expected sing the svg is not a diagram. It is the exported svg.
We should have however a opener for the svg directly.

changed the title

The SVG is going to look exactly like the 'live' diagram, so I fear users are going to be pretty confused when it does not behave the same way.

I don't think we can miss out of a svg viewer because of that however.
User should know from the filename or yang should display something that indicates to the user what he can do in there?


Incorrect odometry when turning vehicle with bicycle steering controller.

Describe the bug
Driving a robot with the bicycle steering controller produces incorrect odometry when turning.
To Reproduce
This was found during development of a hardware interface for a vehicle modeled with a bicycle controller. A minimal example is not provided, but appears to demonstrate similar behavior to #675. The bug is believed to stem from a mismatch of units in steering_odometry.cpp and may affect other ROS2 controllers:

The function update_odometry calls an integrate_exact function with inputs of linear change and angular velocity, SteeringOdometry::integrate_exact(linear_velocity * dt, angular);
a. This differs from a call to the same function in update_open_loop which passes linear and angular change, SteeringOdometry::integrate_exact(linear * dt, angular * dt);
b. The integrate_exact function calculates odometry’s heading_, x_, and y_ from a division of linear change and angular velocity. The heading_ angle is incremented by units of angular velocity. For a controller update rate of 100 Hz, dt = .01, the heading would change 100x faster than the reality.
c. This issue was not found for a linear-only change, as  integrate_exact calls integrate_runge_kutta_2 for near-zero angular change.

The function update_from_velocity appears to calculate the angular velocity.
a. The equation matches that of theta_dot for a bicycle kinematic model, 𝜃_dot = 𝑣 / (L / tan(𝛿)) = 𝑣 * tan(𝛿) / L
b. The variable is named, “angular,” unlike the linear_velocity counterpart in this function. The unit 1/s appears to be lost as it is passed to integrate_exact() via update_odometry().
c. Note that other calls to update_odometry in this file also pass “angular” to update_odometry, so the issue may affect other models.

Expected behavior
It is expected that the odometry would update at a slower rate and better represent the position of the robot’s dead reckoning. The odometry reported for our vehicle had it spin 5+ times in a circle within seconds (see screenshots).
Screenshots
The odometry appears to loop multiple times in 10 seconds, forming a circle:

The expected behavior for a 20 degree steer would be more of a slope away from the forward direction:

Environment (please complete the following information):

OS: Ubuntu 22.04
Version: ROS2 Humble
Run in docker container on Ubuntu 22.04

Additional context
A comment on this closed issue may also be relevant, #611.

I tried to understand the code, but failed..

In the header file, it is written that it should always be of unit m and rad, but it is called velocity.
https://github.com/ros-controls/ros2_controllers/blob/ca38c06f712663449ddf1372234d74a983b7d5f5/steering_controllers_library/include/steering_controllers_library/steering_odometry.hpp#L195-L201
From update_from_position/update_from_velocity I'd say that both are velocities and not displacements.
https://github.com/ros-controls/ros2_controllers/blob/ca38c06f712663449ddf1372234d74a983b7d5f5/steering_controllers_library/src/steering_odometry.cpp#L156-L160
because docs say that inputs are rad/s and rad
https://github.com/ros-controls/ros2_controllers/blob/ca38c06f712663449ddf1372234d74a983b7d5f5/steering_controllers_library/include/steering_controllers_library/steering_odometry.hpp#L114-L124
Why is there the tan() missing, comparing it to the other functions
https://github.com/ros-controls/ros2_controllers/blob/ca38c06f712663449ddf1372234d74a983b7d5f5/steering_controllers_library/src/steering_odometry.cpp#L172
The library lacks any tests for these functions.

@reydelsol would you like to help to sort that stuff out, ideally including simple tests for the functions?

or maybe @petkovich is around and can clarify this?

I am also confused so I started studying the steering libraries, and I'll leave here what I find in hopes that this might be useful in expediting the process of implementing the proposal here:

one confusing item I found was the difference between reference_callback and reference_callback_unstamped in the steering_controllers_library:

https://github.com/ros-controls/ros2_controllers/blob/f62fc3ac5f480b5a74765e642cd33d17600f7f5a/steering_controllers_library/include/steering_controllers_library/steering_controllers_library.hpp#L144-L146
should reference_callback_unstamped also get a STEERING_CONTROLLERS__VISIBILITY_LOCAL?
Also, in reference_callback we have:
https://github.com/ros-controls/ros2_controllers/blob/f62fc3ac5f480b5a74765e642cd33d17600f7f5a/steering_controllers_library/src/steering_controllers_library.cpp#L229-L232
but in reference_callback_unstamped, after making a new twist message we're never writing to input_ref_:
https://github.com/ros-controls/ros2_controllers/blob/f62fc3ac5f480b5a74765e642cd33d17600f7f5a/steering_controllers_library/src/steering_controllers_library.cpp#L265-L268
Am I missing something or is this a bug?

Then, assuming the twist message has been saved, inside update_reference_from_subscribers we set reference_interfaces_ to the linear and angular components of the twist msg:

https://github.com/ros-controls/ros2_controllers/blob/f62fc3ac5f480b5a74765e642cd33d17600f7f5a/steering_controllers_library/src/steering_controllers_library.cpp#L411-L418

Then, inside update_and_write_commands we run update_odometry which is virtual inside steering_controllers_library and each steering controller should define for itself (ackermann, bicycle, and tricycle), which inside each update_odometry two seperate logics are implemented based on open_loop param being set to true or not.

If open_loop is true, odometry will update x_, y_, and heading_. I'm not sure if the calculations are correct considering the this current issue but I added a test here and the file can be found at build/steering_controllers_library/odom_test after colcon build. Two cases of going straight and moving-and-turning a little seem to be working correctly. With open_loop set to true, the steering_odometry object should strictly calculate x_, y_, and heading_, which to the best of my knowledge is what's being done, then each steering_controller subclass has to create values for all the joints it has available.
With this PR a buggy piece of the code will also be fixed.
If open_loop is false, then the values from the states should be read, and from them should the odometry be updated.

More investigation is needed to fully figure out the structure of the code before the proposal can be implemented, but I'm afraid I don't have the time to continue right now.

This should be fixed with https://github.com/ros-controls/ros2_controllers/pull/1150 et al. Please reopen if this still doesn't work out.


Add missing href property to root node

@jdanyow : Thanks for your contribution! The author, @, has been notified to review your proposed change.

@jpconnock - can you take a look at this change to the TOC? thanks!

@jpconnock is OOF for the entire week. This fix looks correct to me.
#sign-off
Fixes https://github.com/MicrosoftDocs/azure-docs/issues/31114

@ggailey777: I'm sorry - only the author of this article, @, can sign off on your changes. But we do have an exception process - if you are on the Microsoft content or product team for this product area, you can ask the PR review team to review and merge it by sending mail to the techdocprs alias.

@Jak-MS can we get this merged without Jean-Paul?


Typo in level "remoteAdvanced1"

Remote is referred as "origin" instead of "o". For example command git pull o master --rebase results in o is not a remote repository! try adding origin that argument, while git pull origin master --rebase works fine.

yeah this is the unfortunate part of our UI -- we cant write out the whole remote name since it is too long, but the remote is truly named origin so the commands still take that in.
probably too late to change this now but thanks for the feedback!

Yeah, I remember this note about o vs origin in hints to some level. But before "remoteAdvanced1" level UI git commands accept o reference just fine...

do they reference it by branch name though?
I guess thats the inconsistency -- the branch name is o/master but the remote is named origin for the other commands :( gah

Any way, thanks for great resource!


Implement DataFrame.coalesce

I would love to use repartition of DataFrames without having to set index (#1380), yet even simple coalesce (merging some partitions together without a need to shuffle/rebalance partitions, like it is done in PySpark) would work in my use-case.
Can this be easily done in Dask? Please, advise where to look for the inspiration (I'm currently trying to get a sense of how repartition and set_index are done, though it is said that they are quite complex and still not complete for distributed use while coalesce should be much easier to implement).

Just to make sure I understand, you're looking to do this on dataframes for which divisions are not known, correct?  If you are interested in contributing a solution for dask.dataframe then you might take a look at dask.bag.Bag.repartition which solves a very similar problem.

Correct. Thank you, I will take a look there.


Handling errors update

Fixes #7535
Fixes #11240
Internal Review Topic

IExceptionHandlerFeature for accessing exception details
Lambda for UseExceptionHandler and demo with the sample app (via a preproc directive)
Improve the Server exception handling section

@glennc 	can you assign someone to review this PR? @Tratcher 	reviews half or our PR's.

@Tratcher kk ... try now.

The sample shouldn't do what we tell them not to do.

Fine by me as long as I don't have to do what we tell them not to do. 😀

@Rick-Anderson Ready for an :eye:.


Support Default GatewayClass and Gateway Management

To simplify the UX (especially for dev's), the project should support managing a default GatewayClass and Gateway. For example, when EG is started with an ENV var or CLI flag such as --default-gateway-class=true and --default-gateway=true it will create the default GatewayClass and default Gateway resources.
Open Questions:

What namespace should be used for the default Gateway? To support the most simple use case, the default namespace can be used? If the Gateway is created in the EG system namespace, then the default Gateway needs to support cross-namespace routing as this ns is not meant for proxied apps, xref.
Should EG support active management of these resources, e.g. someone deletes the default Gateway and EG will recrate it.
Other considerations?

Depending on the overall configuration construction of the solution, I could see the value of adding the GatewayClass by default but not the Gateway.  When implemented to include the allocation of an external IP Address, the address is allocated when the Gateway is created.  This is logical, an IP address has a different lifecycle than a route, allocating an address before its needed doesnt seem like the right correct action.  The second reason this doesnt seem right is that Gateway resources are not global, they are namespaced and would probably be associated with a specific application or team.  To share a Gateway the gateway listener resource is configured with the namespaces that routes can be attached.  Not sure how a sensible default could be constructed

We need to keep in mind the "batteries included" approach to streamline onboarding app devs with Envoy.  The default gc/gw could look similar to this upstream example but include a tls config.


think about how to add test fishing data where available

per @JasonSchaffler suggestion during 3/22/22 tech discussion

@JasonSchaffler, is this wanted?


Add Strainly Case Study

To-do:

[x] Add pdf to btcpayserver.org /case-studies
[x] Add featured image
[ ] Change publishing date based on when we want to publish it

This one is now ready to be squashed and merged prior to announcement.


Can not capture logcat logs on android p

Dear perfetto team
I'm using the code base  https://android.googlesource.com/platform/external/perfetto/ to build the perfetto standalone android builds to test my android p device.  it works fine on lightweight command mode but when I tried to trace logcat logs it dumps an  empty log file and I saw nothing.
Could you please check is this a bug or I missed some configurations?
my build conf:
target_os = "android"
target_cpu = "arm"
is_debug = true
monolithic_binaries = true
perfetto_build_standalone = true
my conf file:
conf.txt
perfetto output:
09-10 11:27:41.335 23809 23809 D perfetto: perfetto_cmd.cc:525     Parsing TraceConfig, 372 bytes
09-10 11:27:41.356 23809 23809 I perfetto: perfetto_cmd.cc:825     Connected to the Perfetto traced service, TTL: 5s
09-10 11:27:41.357   266   266 D perfetto: ing_service_impl.cc:455 Consumer 0xf6a4b280 connected from UID 0
09-10 11:27:41.357   266   266 D perfetto: ing_service_impl.cc:547 Enabling tracing for consumer 0xf6a33180
09-10 11:27:41.357   266   266 D perfetto: ng_service_impl.cc:2533 Setting up data source android.log with target buffer 3
09-10 11:27:41.358   266   266 I perfetto: ing_service_impl.cc:928 Configured tracing session 3, #sources:1, duration:5000 ms, #buffers:1, total buffer size:32768 KB, total sessions:1, uid:0 session name: ""
09-10 11:27:41.363   267   267 D perfetto: probes_producer.cc:158  SetupDataSource(id=3, name=android.log)
09-10 11:27:41.364   267   267 D perfetto: probes_producer.cc:198  StartDataSource(id=3, name=android.log)
09-10 11:27:41.373   267   267 D perfetto: _log_data_source.cc:172 Starting Android log data source: stream tail=1 lids=0,3,1,2,4,7
09-10 11:27:41.375   266   266 D perfetto: ng_service_impl.cc:1345 All data sources started
09-10 11:27:46.362   266   266 D perfetto: ng_service_impl.cc:1832 Triggering final flush for 3
09-10 11:27:46.364   267   267 D perfetto: probes_producer.cc:417  Flush 3 acked by data source 3
09-10 11:27:46.364   267   267 D perfetto: probes_producer.cc:429  All data sources acked to flush 3
09-10 11:27:46.365   266   266 I perfetto: ng_service_impl.cc:1837 FlushAndDisableTracing(3) done, success=1
09-10 11:27:46.365   267   267 I perfetto: probes_producer.cc:340  Producer stop (id=3)
09-10 11:27:46.371 23809 23809 I perfetto: perfetto_cmd.cc:949     Wrote 874 bytes into /data/misc/perfetto-traces/trace_file.perfetto-trace
09-10 11:27:46.372   266   266 D perfetto: ing_service_impl.cc:472 Consumer 0xf6a33180 disconnected
09-10 11:27:46.372   266   266 D perfetto: ng_service_impl.cc:2278 Freeing buffers for session 3
09-10 11:27:46.373   266   266 I perfetto: ng_service_impl.cc:2309 Tracing session 3 ended, total sessions:0
thank you

Are you running this as "shell" or "root"?
If you sideload perfetto, accessing logcat might require root.
Any selinux denials on /dev/logr?

Are you running this as "shell" or "root"?
If you sideload perfetto, accessing logcat might require root.
Any selinux denials on /dev/logr?

hi Primiano, thanks for your reply. I was running this on root and SElinux was set on permissive via setenforce 0. so I do not think there was any permission denied.

indeed, with your hint, I found some traces through dmesg
[Fri Sep 10 14:02:23 2021] type=1400 audit(1631275344.174:213): avc: denied { write } for pid=267 comm="traced_probes" name="logdr" dev="tmpfs" ino=243 scontext=u:r:traced_probes:s0 tcontext=u:object_r:logdr_socket:s0 tclass=sock_file permissive=1
[Fri Sep 10 14:02:23 2021] type=1400 audit(1631275344.174:213): avc: denied { write } for pid=267 comm="traced_probes" name="logdr" dev="tmpfs" ino=243 scontext=u:r:traced_probes:s0 tcontext=u:object_r:logdr_socket:s0 tclass=sock_file permissive=1
[Fri Sep 10 14:02:23 2021] type=1400 audit(1631275344.174:214): avc: denied { connectto } for pid=267 comm="traced_probes" path="/dev/socket/logdr" scontext=u:r:traced_probes:s0 tcontext=u:r:logd:s0 tclass=unix_stream_socket permissive=1
it seems traced_probes still got permission denials on mode permissive.

permissive=1 shouldn't cause blockages though (did you restart traced_probes after setenforce 0 though?).
I can't explain why this shouldn't work with root with selinux disabled.
What's the size of the resulting trace?

after restart the traced suites via adb shell setprop persist.traced.enable 0 then 1.  perfetto dumped a slight different result.
[177.668] perfetto_cmd.cc:825     Connected to the Perfetto traced service, TTL: 5s
[182.679] perfetto_cmd.cc:949     Wrote 1001 bytes into /data/misc/perfetto-traces/trace.test
I've a trace file with one line logcat
0.000 000 100Dperfettong_service_impl.cc:1345 All data sources started
trace.test.zip

Hmmw which user is traced_probes running as?
Android's logd has a futher security check that works as follows, IIRC:

If the connecting user id is shell or root (or some system service) allows to read all logs
Otherwise it allows to read only logs emitted by the connecting UID.

Feels like this is what's happening here?

Hmmw which user is traced_probes running as?
Android's logd has a futher security check that works as follows, IIRC:

If the connecting user id is shell or root (or some system service) allows to read all logs
Otherwise it allows to read only logs emitted by the connecting UID.

Feels like this is what's happening here?

nice catch, just checked, originally,  traced_probes is ran by nobody.
I had a quick test with root, now it works like a charm
appreciate for your quick reply and help, sir.

just for curiosity, how to auto create the root or system running traced traced_probe via setprop ?

traced_probes doesn't run as root ever, always runs as nobody.
But there is a secret for accessing logcat, which works only on userdebug.
The secret is the union of:

perfetto.rc adding traced_probes to the "log" group:
service traced_probes /system/bin/traced_probes
...
 # Despite the "log" group below, traced_probes is allowed to read log
 # only on userdebug/eng via selinux (see traced_probes.te).
 group nobody readproc log

When I said "shell or root" above it was incomplete. It's really: shell, root or anything in the log group.

On top of that, it requires selinux rules. From traced_probes.te:

# On debug builds allow to ingest system logs into the trace.
userdebug_or_eng(`read_logd(traced_probes)')


⚠ Bofrost.nl has degraded performance

In 5e23bbc, Bofrost.nl (https://www.bofrost.nl) experienced degraded performance:

HTTP code: 200
Response time: 1270 ms

Resolved: Bofrost.nl performance has improved in 1f3ffa3.