First frame janks after UI has been idle for a few seconds, when laptop is on low battery

When my laptop is disconnected from power plug and is running on medium to low battery my app has a serious performance issue.
If I leave the app alone for a few seconds (~5-10) and then I scroll a ListView or do some other interaction, the first frame takes a ridiculous amount of time (~600ms) and then subsequent frames are under (16ms = UI + Raster).
I can see on the profiler that the function that is causing the jank is FlutterCompositorCreateBackingStore() which takes somewhere around 680ms to complete.
I've managed to reproduce this issue on 2 devices, both MacBook Pro (15-inch, 2018), on two different OS versions (Big Sur & Monterrey)
[✓] Flutter (Channel unknown, 2.10.0-0.3.pre, on macOS 12.2.1 21D62 darwin-x64, locale en-GB)
• Flutter version 2.10.0-0.3.pre
• Upstream repository unknown
• Framework revision fdd0af78bb (6 weeks ago), 2022-01-25 22:01:33 -0600
• Engine revision 5ac30ef0c7
• Dart version 2.16.0 (build 2.16.0-134.5.beta)
• DevTools version 2.9.2
Any pointers or ideas of why this is happening? I've tried to look deep into the flutter code but it is hard for me to understand exactly what's happening in FlutterCompositorCreateBackingStore() and how my laptop running on low battery can affect that.

Do you have low power graphics mode enabled?
https://www.macworld.com/article/348837/macos-monterey-low-power-mode-system-preferences-how-to-enable.html

@alexvoina
Are you seeing the jank on iOS device or desktop platform ?
I see that you are on Channel unknown, 2.10.0-0.3.pre, which could be master or beta. Can you upgrade to latest version and try again to see if the behavior still persists ?
If so, can you provide a complete minimal reproducible code sample along with a short video or gif that shows the first frame jank ?
Also check above mentioned link if it helps.

thanks @darshankawar @SpencerC for the quick replies
@darshankawar it's on desktop
I found what the problem is and I really don't know how this slipped (sorry to waste your time).

This issue is happening when the "Automatic graphics switching" option is enabled (which is enabled by default). From my point of view, I can do my best to inform users how to avoid this problem (my guess is that Apple should do that too).
Here's a screenshot from the profiler.

Do you still want me to test this on latest and provide minimal repro code, given the circumstances? You just have to let an app go out of focus (either switch tabs, or let it 'sleep' for a few seconds), and then go back and scroll a ListView...

Thanks for the update @alexvoina. You can try to set NSSupportsAutomaticGraphicsSwitching to YES in macos/Runner/Info.plist and see if it helps to improve the performance or not.

Ha! I actually googled to see if I can access these settings programatically, but didn't find anything. It seems like NSSupportsAutomaticGraphicsSwitching should do the job! Thanks, I'll let you know if that solves the problem 👍

@darshankawar setting NSSupportsAutomaticGraphicsSwitching to YES in macos/Runner/Info.plist doesn't help solving the problem
here's Apple explanation of this
A: Starting with OS X 10.7, you may choose to run your OpenGL application on the integrated GPU on the dual-GPU MacBook Pros shipped Early 2011 and after.
By default, once your application creates an OpenGL context (by either calling OpenGL directly or an API that relies on OpenGL such as Core Animation, Core Image, etc), the MacBook Pro automatically switches to the higher-end discrete GPU for performance concerns and won't switch back until the application quits. On OS X 10.6 and earlier, you are not allowed to choose to run on the integrated GPU instead. Starting with OS X 10.7, you may utilize the integrated GPU on the MacBook Pros if you want to, for example, to save battery life.
On OS X 10.7 and later, there is a new attribute called NSSupportsAutomaticGraphicsSwitching. To allow your OpenGL application to utilize the integrated GPU, you must add in the Info.plist of your application this key with a Boolean value of true
https://developer.apple.com/library/archive/qa/qa1734/_index.html#//apple_ref/doc/uid/DTS40010791
My understanding is that this will only allow my app to jump back to use the integrated GPU... Ideally, I want my app to use the discrete (high-performance GPU) all the time. It also might be fine running on the integrated GPU all the time too, even though that would be a big underuse of the device's resources... What I definitely don't want, is to have the app switching between the 2, causing this jank so frequently. It really destroys the user experience.
I've tried setting NSSupportsAutomaticGraphicsSwitching to NO, but that doesn't help either... The only thing that works is to disable Automatic Graphics Switching as shown in the picture from my previous comment.
once your application creates an OpenGL context (by either calling OpenGL directly or an API that relies on OpenGL such as Core Animation, Core Image, etc), the MacBook Pro automatically switches to the higher-end discrete GPU for performance concerns and won't switch back until the application quits
It feels like flutter has modified something to force the MacBook Pro to switch back every time the app goes idle (~5 secs), instead of letting it run on the discrete GPU until the app quits.

@alexvoina
Thanks for further updates on this. I am assuming you are still on the version you reported this behavior on. Probably a good idea to upgrade to latest and see if updating the version has made any difference / impact on the performance or not.

no difference

My understanding is that this will only allow my app to jump back to use the integrated GPU... Ideally, I want my app to use the discrete (high-performance GPU) all the time.

See this similar open issue https://github.com/flutter/flutter/issues/47822


Create concept of persistent ThreadContext headers that are unstashable

Description
This PR introduces the concept of "persistent" ThreadContext headers modeled after transient headers. These headers perform exactly the same as ThreadContext headers, but are not stashable and will always be available even inside a block where the ThreadContext has been stashed.
Some additional context on the ThreadContext:
The values in the ThreadContext are immutable after they have already been written to once. If a caller tries to overwrite an existing ThreadContext header than the caller will receive an IllegalArgumentException.
Related Issues
Resolves https://github.com/opensearch-project/security/issues/2909
Check List

[ ] New functionality includes testing.

[ ] All tests pass

[ ] New functionality has been documented.

[ ] New functionality has javadoc added

[ ] Commits are signed per the DCO using --signoff
[ ] Commit changes are listed out in CHANGELOG.md file (See: Changelog)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@dblock @andrross any concerns folks?

This PR is building up features around stashing context, what about eliminating the need for plugins to access this API, what would that take?

@peternied One assurance that plugins cannot read from the persistent headers is that if an object is stored there that is only known to the plugin and no other plugins (i.e. the Security User object), then other plugins cannot read it since their classloaders don't have access to the Security User object.
I am also looking at a more JSM style approach, or similar, that would let only the IdentityPlugin utilize the ThreadContext and no other plugins. Or making it more targeted and forbidding accessing certain headers or areas of the ThreadContext.

This feature adds overhead in latency/bandwidth to every transport request without providing a better security implementation in the short term.

I have not measured that, but I don't anticipate a hit to performance by storing the authenticated user as a persistent header (not currently implemented yet in the security plugin). I will try to gather data on that, but the impact should be marginal.

End of the day we've got the performance testing requirements pre-release and we can use that to detect issues, lets lean on those instead of trying to micro-optimize/analyze in this scenario.
Lets merge this and keep iteration - thanks for the contribution @cwperks

will need a manual backport, as usual

Creating a manual backport now

@dblock Created backport PR: https://github.com/opensearch-project/OpenSearch/pull/8507


Calculation of AP metric

Hello,
When I ran your evaluation matlab script, I got the results: ODS=0.774, OIS=0.789, AP=0.756 using your pre-computed nms images for NYUD-RGB. However, you reported an AP metric of 79.7, there is a considerable difference between these results. When I checked the AP array, I noticed that your results didn't have results for recall value >= 0.9, and you interpolated AP for these missing values. The following figure is taken from your supplementary material, and I show these missing AP values with a black rectangle.

I wonder if this is how you calculate AP.
Thanks.

Please refer to our eval code, thanks~


Visual identity

I don't want to distract from more important issues but...
Redux has been as game-changing as React for me, and I want to talk about it at meetups and conferences. The problem is that I don't have a logo to go along the React one in my slides!
Does anybody think it'd be a good thing to design one?

There was a lot of discussion about this on #151, including a bunch of logo ideas. Doesn't look like any of them has gone forward at this point though.

We'll have a logo eventually. Give it more time. ;-) I'll post in #151 if we settle on something.


Futures

It is not listing open trades in futures.
client.futures_get_open_orders()

That endpoint will only list open orders, not trades.
To view your open positions you need to use the following and filter by symbol:
client.futures_position_information()

To cancel the order, I could not.
what procedure to search ID and cancel the order?

You can view your open orders with the following:
client.futures_get_open_orders()
You can also filter by symbol:
client.futures_get_open_orders(symbol='BTCUSDT')
These will return the orderId which you can then use to cancel the order. Both the symbol and orderId parameters are required (replace orderId with the value that was returned by the previous endpoint):
client.futures_cancel_order(symbol='BTCUSDT', orderId=orderId)


ncurses: if enableStatic is set, don't remove the "*.a" files!

Motivation for this change
This seems to be the intended behavior for enableStatic, and only changes behavior when intentionally opt'ing into a static ncurses.
cc @Ericson2314 (introduced the option in 3a672cb7d2194f859bf8b576359488ddb088aca5)
Things done

[ ] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
Built on platform(s)

[ ] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Fits CONTRIBUTING.md.

Success on x86_64-linux (full log)
Attempted: ncurses
Partial log (click to expand)
/nix/store/q8rg4mca5zqv98arpxd7164pqa72hf1n-ncurses-6.1

Success on x86_64-darwin (full log)
Attempted: ncurses
Partial log (click to expand)
/nix/store/3mrldk4v82yjzh2ycnx8wnycpqmahar8-ncurses-6.1

Success on aarch64-linux (full log)
Attempted: ncurses
Partial log (click to expand)
/nix/store/6sv93vyryl27i7vw4hm9dmqbvvzjnadr-ncurses-6.1

Success on x86_64-linux (full log)
Attempted: ncurses
Partial log (click to expand)
/nix/store/q8rg4mca5zqv98arpxd7164pqa72hf1n-ncurses-6.1

Success on x86_64-darwin (full log)
Attempted: ncurses
Partial log (click to expand)
/nix/store/3mrldk4v82yjzh2ycnx8wnycpqmahar8-ncurses-6.1

Success on aarch64-linux (full log)
Attempted: ncurses
Partial log (click to expand)
/nix/store/6sv93vyryl27i7vw4hm9dmqbvvzjnadr-ncurses-6.1

@GrahamcOfBorg build ncurses ncurses5 pkgsMusl.ncurses pkgsMusl.ncurses5

Success on x86_64-darwin (full log)
Attempted: ncurses, ncurses5
The following builds were skipped because they don't evaluate on x86_64-darwin: pkgsMusl.ncurses, pkgsMusl.ncurses5
Partial log (click to expand)
error: Musl libc only supports Linux systems.

Cannot nix-instantiate `pkgsMusl.ncurses5' because:
error: Musl libc only supports Linux systems.

these paths will be fetched (0.38 MiB download, 2.99 MiB unpacked):
  /nix/store/r8psghzmq44plgh4npcm33h0vgxrwpik-ncurses-6.1-abi5-compat
copying path '/nix/store/r8psghzmq44plgh4npcm33h0vgxrwpik-ncurses-6.1-abi5-compat' from 'https://cache.nixos.org'...
/nix/store/3mrldk4v82yjzh2ycnx8wnycpqmahar8-ncurses-6.1
/nix/store/r8psghzmq44plgh4npcm33h0vgxrwpik-ncurses-6.1-abi5-compat

Failure on x86_64-linux (full log)
Attempted: ncurses, ncurses5, pkgsMusl.ncurses, pkgsMusl.ncurses5
Partial log (click to expand)
cannot build derivation '/nix/store/15hvr7cngd12l9i84bkpni55l54v2cia-binutils-wrapper-2.30.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/s0zq6q4bf7970m75rhig9qgxhyzljff9-diffutils-3.6.drv': 3 dependencies couldn't be built
cannot build derivation '/nix/store/csli3rap0rnzffi7ld4hs9qq15qfx3vz-ed-1.14.2.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/gj91l8gsy7cv17bq0r7qmr1dplgx4l6a-findutils-4.6.0.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/q2plzj674fpcn3l21l6gd184nszjizi2-gcc-wrapper-7.3.0.drv': 5 dependencies couldn't be built
cannot build derivation '/nix/store/i928fgfssh6si0rjhps8r8a433jqrbs5-stdenv-linux.drv': 24 dependencies couldn't be built
cannot build derivation '/nix/store/nvyiap1s08jcr7l5kzcch1finlq8hm9d-pkg-config-0.29.2.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/fvlbxz56ffijylr40iy352slssmhz2zr-ncurses-6.1-abi5-compat.drv': 4 dependencies couldn't be built
cannot build derivation '/nix/store/qjl3x749fiqhzhvknq5074cha4gybsbq-ncurses-6.1.drv': 4 dependencies couldn't be built
error: build of '/nix/store/fvlbxz56ffijylr40iy352slssmhz2zr-ncurses-6.1-abi5-compat.drv', '/nix/store/qjl3x749fiqhzhvknq5074cha4gybsbq-ncurses-6.1.drv' failed

Looks like this was fixed similarly by @shlevy ( af315bb6c82200dcc0a7cf4111126c1c3fd67b7e ) -- although that makes the libtinfo link which I didn't here so looks like this is not needed :).
I was looking at using ncurses' ability to create libtinfo itself (see INSTALL docs, IIRC --with-termlib) but that generates split libraries which is just fine for static but for shared might be less desired.

Why has this issue been around for months and both of us hit it the same day? :grinning:


[BUG] Snowpack 3.1.1 fails with react-router-dom - incorrect namespace import

Bug Report Quick Checklist

[x] I am on the latest version of Snowpack & all plugins.
[x] I use package manager npm (Fill in: npm, yarn, pnpm, etc).
[x] I run Snowpack on OS macos (Fill in: Windows, Mac, Linux, etc).
[x] I run Snowpack on Node.js v12+

Describe the bug
Using react-router-dom fails in Snowpack 3.1.1 when used in conjunction with
React 16.14.0. This previously worked in Snowpack 3.0.13.
Attempting to use the router results in the following error:
Uncaught TypeError: checkPropTypes is not a function
    at validatePropTypes (react.v16.14.0.js:1729)

I suspect this is because react's compiled output expects checkPropTypes to be a
function however it is imported using a namespace definition which is not callable.
// At the top of /_snowpack/pkg/react.v16.14.0.js
import * as checkPropTypes from '/_snowpack/pkg/prop-types.checkPropTypes.v15.7.2.js';

The issue goes away if I either:

Use snowpack 3.0.13 and react 16.14.0 (downgrade snowpack, keep react version)
Use snowpack 3.1.1 and react >=17.0.0 (keep snowpack version, update react)

To Reproduce
Reproduction repository is here

clone repository and go into the react-router-prop-types folder
npm install && npm start
See error as described above

General steps

Use snowpack 3.1.1
Use react 16.14.0
Use react-router-dom 5.2.0
Add  an importimport { BrowserRouter as Router } from "react-router-dom"; in App component
Add the Router somewhere in your App component <Router></Router>

Expected behavior
Page to render, no errors

@BPScott thanks for filing. Funny enough, I tracked this down to the snippet of code that we'd originally talked through related to ESM vs. CJS detection. More details here, including the fix to add back that check: https://github.com/snowpackjs/snowpack/pull/2934
I'll get this out tonight


[AutoRelease] t2-workloads-2023-02-22-55848(can only be merged by SDK owner)

https://github.com/Azure/sdk-release-request/issues/3830
Live test success

issue link:https://github.com/Azure/sdk-release-request/issues/3830


Should restart docker daemon when new docker binary is put into place

The LWRP should restart the docker daemon when its remote_file[docker_bin] resource updates the docker binary on disk. Otherwise, invocations of the new docker binary fail when they try to use a newer version of the API to communicate with the running docker daemon.
I would submit a PR, but I'm having trouble figuring out how to have the DockerService LWRP to notify its own restart action in the remote_file resource. It seems like this should be a straightforward change, but if there's anything I can do to help or test, please let me know!

To give a concrete example,
For example, if my recipe had the following code:
docker_service 'default' do
  # implicit version for ubuntu 14.04: docker 1.6.2
  action [:create, :start]
end

And converges successfully,
Then I change my code to:
docker_service 'default' do
  version '1.8.1' # because I need a docker 1.8 feature such as fluentd logging drivers.
  action [:create, :start]
end

Then the node will appear to successfully converge, but any interactive docker command done after the chef-run will fail, for example this one:
root@docker2-ubuntu-1404:~# docker images
Error response from daemon: client and server don't have same version (client : 1.20, server: 1.18)

Upgrading the docker binary should have resulted in restarting the docker service, so that the client binary and the server always talk the same version of the API.

Fixed in v1.0.34


Dispatch improvements

Describe the feature
Just a few things I've noticed while running as dispatch lately (which has otherwise been amazing):

[x] The right click options for state setting which are super helpful would also be super helpful for EMS/FD units.
[x] The formatting of 911 call events could be improved to use more of the blank space before requiring a scroll bar (see below).
[ ] Extend the use of incidents so that there is an extra section very similar to 911 calls that allows Dispatch to create incidents that units can be assigned to. This is useful in scenarios where off the cuff incidents occur that aren't 911 calls. It would be good if this was also a column for units so you can see where units are assigned if they are with a pop out modal button for the full call/incident details.

Additional Context

Extend the use of incidents so that there is an extra section very similar to 911 calls that allows Dispatch to create incidents that units can be assigned to. This is useful in scenarios where off the cuff incidents occur that aren't 911 calls. It would be good if this was also a column for units so you can see where units are assigned if they are with a pop out modal button for the full call/incident details.

Are you able to share an image/video demonstration for this? I'm not 100% sure what you mean with this 😅.

Hmm... something along the lines of this?

Would these incidents also show on the incidents page?

Would these incidents also show on the incidents page?

Sure! The officer might just be listed as 'Dispatch' or something for ones created via that method.

@jxckUK, only 1 call can have an active incident?

@jxckUK, only 1 call can have an active incident?

Not too sure what you mean? In this use case you should be able to have multiple incidents not linked to calls

Oh, right! Lol, totally forgot about that, nevermind that question

Something like this for the table view?

Something like this for the table view?

Looks good to me, and you can assign units above and see that they're active on an incident?

Looks good to me, and you can assign units above and see that they're active on an incident?

Yup, will be working on that soon. First doing to active incidents stuff.

I'm not sure what I should name the "end"/"deactive" active incident button. Since non-active incidents will go to the officers incidents page and do not show on the dispatch page; Suggestions :)?

@jxckUK, would this #5 be an action? What would it do if it were one?

🚀
https://user-images.githubusercontent.com/53900565/155008495-4bdb878e-bf5b-485a-bcee-27a99b2ce27e.mov

🚀
2022-02-21.19-16-39.mov

Yes! This is spot on - I now get the previous question about the #5 it wasn't from the incident panel it was from the active units one right? In that case it might be good for it to open the incident? :D

it wasn't from the incident panel it was from the active units one right? In that case it might be good for it to open the incident? 😄

Yeah. Should it open in read-only mode for the officer?

it wasn't from the incident panel it was from the active units one right? In that case it might be good for it to open the incident? 😄

Yeah. Should it open in read-only mode for the officer?

Erm - not necessarily as they should be able to add details if they're in the CAD but then again maybe they shouldn't do that until its ended. Tough one, maybe a settings toggle?

Erm - not necessarily as they should be able to add details if they're in the CAD but then again maybe they shouldn't do that until its ended. Tough one, maybe a settings toggle?

Meh. I think it should be fine tbh. Will see if there's feedback for it later down the road :)

This was quite a fun feature to implement! Enjoy 🚀!


refactor(linter): refactor LintBuilder to prep for nested configs

More simplification/preparations for nested configurations:

renames LinterBuilder to ConfigStoreBuilder
moves the options logic out of LintBuilder
make ConfigStoreBuilder::build() return a result (currently always returns OK, but it will return errors when nested config is implemented

The next steps to implement nested config which i hope to do in the next week are:

refactor the from_oxlintrc to accept a file path
introduce a new method on ConfigStoreBuilder (name TBC) that walks all child directories, collecting .oxlintrc files. these will be put into ConfigStore as a hash map of path > config.

[!WARNING]
This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

#8034  👈 (View in Graphite)
#8033
#8032
main

How to use the Graphite Merge Queue
Add either label to this PR to merge it via the merge queue:

0-merge - adds this PR to the back of the merge queue
hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Thanks for taking a look at this, I'll review this as soon as possible. I had a draft of the nested config work on my laptop but wasn't happy with it so far.

Thanks for taking a look at this, I'll review this as soon as possible. I had a draft of the nested config work on my laptop but wasn't happy with it so far.

ah sorry! i didn't realize you had already started implementing this.
feel free to close this one in favour of yours!

You may merge after fixing the compile error.


blocksJSON are messing with useGatsbyImage

Hi all,
I am using Gutenberg as the main editor and I have lots of different innerBlocks with different attributes and it is getting too overwhelming with direct querying or fragments. I found a WP plugin WP GraphQL Gutenberg that enables me to expose Gutenberg blocks and also expose them as a stringified JSON, which is super useful for me.
However, when I am sourcing data through your plugin and have the useGatsbyImage API set to true, it returns me an error, because it also goes through the url parser (error right below).
url passed to create-remote-file-node is either missing or not a proper web uri: %5C%22https:%5C/%5C/...

I tried adding .replace with regex for backslash and double-quotes, which works, but breaks the stringified JSON response (no escaping of double quotes now).
Falsing useGatsbyImage lets me build the site, but then I cannot query the media within the blocks.
Excluding blocksJSON field name lets me build the site, but I would have to write all the fragments.
How to reproduce
Use WP site with Gutenberg, use WP GraphQL Gutenberg plugin together with other necessary WP GraphQL plugins, use gatsby-source-wordpress-experimental in your Gatsby project with enabled useGatsbyImage, you should get an error.
What is expected
There can be more options:

This plugin would skip URLs it doesn't understand (e.g. these from blocksJSON with backslashes) not return an error.
This plugin would clean these URLs first and would return the gatsby-image block, but would not break the stringified JSON if that's possible
This plugin would skip the URLs from  element and would look for blocks attributes.url or something similar

I am using latest versions of all plugins and Gatsby.

Same issue is happening to me, although I'm not running the WP GraphQL Gutenberg. For now, I have to set html.useGatsbyImage to false for my build to work.
url passed to create-remote-file-node is either missing or not a proper web uri: %5C%22https:%5C/%5C/XXXXXX.com%5C/wp-content%5C/uploads%5C/2019%5C/11%5C/super-soft-tee-Size-chart-web-1024x350.png%5C%22

Exactly the scenario described by @petrmrkvicka happens to me. Going back to version 1.3.1 fixed it temporarily.

Hi @TylerBarnes have you had a chance to take a look? Thanks

Hi everyone, I've been away on vacation the last 2 weeks. I'm just sorting through all my notifications and prioritizing things now. I'll keep you posted on this issue.

So before I headed out for vacation I had started on writing some resolver data integrity integration tests for wp-graphql-gutenberg in Gatsby. Picked that up again yesterday evening and ran into this bug pretty quick! So I have a fix coming probably later today, just need to finish these tests and make sure nothing else is affected due to my fix.

A fix is published in<EMAIL_ADDRESS>

Tested and it works, thanks!


Transparency issue on Notifications

VS CODE INSIDER V 1.43
Install my theme "Apophis Dark Matter"
https://marketplace.visualstudio.com/items?itemName=nicola-granata.apophis-dark-matter
My theme has transparency on Menu and Notifications.
Issue on Menu is solved (https://github.com/microsoft/vscode/issues/85690)
This issue seems to be similar but in notifications area: stripes with full transparency between stripes without transparency.
Thanks.

(apparently)
Solved  by myself:  there is an issue (a misprint) on my config theme generator (an override with 75% of transparency instead of 11% )
I published theme without this issue.
I apologize.
Thanks.

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

Dropdown menu transparency issue: stripes with half-transparency under items (#85690)


Long byte string / regular string not binding as varbinary(max), varchar(max) when fast_executemany=True

Please first make sure you have looked at:

Documentation: https://github.com/mkleehammer/pyodbc/wiki
Other issues

Environment
To diagnose, we usually need to know the following, including version numbers.  On Windows, be
sure to specify 32-bit Python or 64-bit:

Python: 3.8.5 (OS X) and 3.8.7 (Windows 64 bit)
pyodbc: 4.0.30
OS: 10.15.7 (OS X) and 10 (Windows...unsure what build #)
DB: SQL Server 2019
driver: FreeTDS (OS X), ODBC Driver 17 for SQL Server (Windows)

Issue
When fast_executemany=True, long binary or string input values are not converted to the correct ODBC type it seems. Note that my examples below focus on using
Observed Behavior and MRE
Consider tables defined as follows:
CREATE TABLE binTest (
    ID int,
    bin varbinary
);

CREATE TABLE strTest (
    ID int,
    val varchar(max)
);

When running the following Python script (OS X example shown, but same occurs with equivalent Windows conn string), a

'String data, right truncation: length 8500 buffer 255'

error is returned for binTest.
import pyodbc

conn: pyodbc.Connection = pyodbc.connect("DSN=dockersql;UID=SA;PWD=?")
cur: pyodbc.Cursor = conn.cursor()
cur.fast_executemany = True

strToTest = 'a'*8500
binToTest = bytearray(strToTest,'utf8')

sql = """
INSERT INTO binTest VALUES (?,?)
"""
params = [(1, binToTest)]
cur.executemany(sql, params)
cur.commit()

sql =  """
INSERT INTO strTest VALUES (?,?)
"""
params = [(1, strToTest)]
cur.executemany(sql, params)
cur.commit()

When commenting the binTest portion and doing the strTest portion, similar behavior happens:

'String data, right truncation: length 17000 buffer 510'

A workaround I have found is to manually specify the input type for the column as varbinary,0 or varchar,0
cur.setinputsizes([None, None, (pyodbc.SQL_VARBINARY,0)])
cur.setinputsizes([None, None, (pyodbc.SQL_VARCHAR,0)])

Could you provide an ODBC trace? I believe it should be using DAE for those long types....

When I try and run your repro code I get

pyodbc.ProgrammingError: ('String data, right truncation: length 8500 buffer 1', 'HY000')

because varbinary (without a length) is interpreted as varbinary(1).
Once I fix that, your code runs fine for me.
# https://github.com/mkleehammer/pyodbc/issues/867
import sys

import pyodbc

print(sys.version)
# 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:37:30) [MSC v.1927 32 bit (Intel)]
print(pyodbc.version)
# 4.0.30

connection_string = (
    "DRIVER=ODBC Driver 17 for SQL Server;"
    "SERVER=<IP_ADDRESS>;"
    "DATABASE=test;"
    "UID=scott;PWD=tiger^5HHH;"
)
conn: pyodbc.Connection = pyodbc.connect(connection_string)
cur: pyodbc.Cursor = conn.cursor()

print(cur.execute("SELECT @@VERSION").fetchval())
"""
Microsoft SQL Server 2019 (RTM-CU3) (KB4538853) - 15.0.4023.6 (X64)
	Mar  4 2020 00:59:26
	Copyright (C) 2019 Microsoft Corporation
	Developer Edition (64-bit) on Linux (Ubuntu 18.04.4 LTS) <X64>
"""

cur.execute("DROP TABLE IF EXISTS binTest")
cur.execute("""\
CREATE TABLE binTest (
    ID int,
    val varbinary(max)
);
""")

cur.execute("DROP TABLE IF EXISTS strTest")
cur.execute("""\
CREATE TABLE strTest (
    ID int,
    val varchar(max)
);
""")

strToTest = 'a'*8500
binToTest = bytearray(strToTest,'utf8')

cur.fast_executemany = True

sql = """
INSERT INTO binTest VALUES (?,?)
"""
params = [(1, binToTest)]
cur.executemany(sql, params)
cur.commit()

sql =  """
INSERT INTO strTest VALUES (?,?)
"""
params = [(1, strToTest)]
cur.executemany(sql, params)
cur.commit()

@gordthompson Guess this is a classic case of oversimplification and assumption :)
You are of course right about varbinary(max)--had corrected it at some point but forgot to update the create statement. You're also right about this example running perfectly on Windows. I was actually trying to troubleshoot a different issue, and thought this simple case might have been the root cause, and when I had success on OS X I assumed I was right and didn't retest this simpler case on Windows before I posted. This issue as I have it written does persist on OS X, though, for both the binary and string cases--given that it works on Windows this might be a unixODBC or FreeTDS issue?
I'll post a separate issue about the more involved case I was looking at that fails (for sure this time!) on both Windows and OS X. It involves some geometry functionality so I thought a simpler use case might have been beneficial, but I guess that didn't pan out as nicely as I'd hoped.

Note that the Microsoft ODBC Driver for SQL Server is available for Mac too - if it works with that, then bug is in FreeTDS.

I just tried the MS ODBC driver -- the binary insert works now, but not the string insert. @v-chojas you mentioned an ODBC trace earlier, how do I do that?

https://github.com/mkleehammer/pyodbc/wiki/Troubleshooting-–-Generating-an-ODBC-trace-log

Attaching the ODBC trace (UID/PWD removed from connection string). Using MS ODBC driver here.
odbc_binary.txt
odbc_varchar.txt

My test code runs okay on Xubuntu 18.04, too.
odbctrace.txt
I notice that the SQLDescribeParam calls work okay for me
[ODBC][3518][1613051791.846856][SQLPrepareW.c][165]
        Entry:
            Statement = 0x13a3d00
            SQL = [
INSERT INTO strTest VALUES (?,?)
][length = 34]
[ODBC][3518][1613051791.846869][SQLPrepareW.c][346]
        Exit:[SQL_SUCCESS]
[ODBC][3518][1613051791.846873][SQLNumParams.c][144]
        Entry:
            Statement = 0x13a3d00
            Param Count = 0x7ffe746676c6
[ODBC][3518][1613051791.846878][SQLNumParams.c][231]
        Exit:[SQL_SUCCESS]
            Count = 0x7ffe746676c6 -> 2
[ODBC][3518][1613051791.846883][SQLDescribeParam.c][185]
        Entry:
            Statement = 0x13a3d00
            Parameter Number = 1
            SQL Type = 0x13ad0b2
            Param Def = 0x13ad0b8
            Scale = 0x13ad0c0
            Nullable = 0x7ffe746677a8
[ODBC][3518][1613051791.851229][SQLDescribeParam.c][338]
        Exit:[SQL_SUCCESS]
            SQL Type = 0x7ffe74667220
            Param Def = 0x7ffe74667310
            Scale = 0x7ffe74667400
            Nullable = 0x7ffe746674f0
[ODBC][3518][1613051791.851251][SQLDescribeParam.c][185]
        Entry:
            Statement = 0x13a3d00
            Parameter Number = 2
            SQL Type = 0x13ad11a
            Param Def = 0x13ad120
            Scale = 0x13ad128
            Nullable = 0x7ffe746677a8
[ODBC][3518][1613051791.851264][SQLDescribeParam.c][338]
        Exit:[SQL_SUCCESS]
            SQL Type = 0x7ffe74667220
            Param Def = 0x7ffe74667310
            Scale = 0x7ffe74667400
            Nullable = 0x7ffe746674f0

but the corresponding calls from @ww2406 's "odbc_varchar.txt" show Exit:[SQL_ERROR]
[ODBC][32303][1612998942.259466][SQLPrepareW.c][165]
        Entry:
            Statement = 0x7f97b2821a00
            SQL = [
INSERT INTO strTest VALUES (?,?)
][length = 34]
[ODBC][32303][1612998942.259521][SQLPrepareW.c][346]
        Exit:[SQL_SUCCESS]
[ODBC][32303][1612998942.259567][SQLNumParams.c][144]
        Entry:
            Statement = 0x7f97b2821a00
            Param Count = 0x7ffee6d83d4e
[ODBC][32303][1612998942.259674][SQLNumParams.c][231]
        Exit:[SQL_SUCCESS]
            Count = 0x7ffee6d83d4e -> 2
[ODBC][32303][1612998942.259725][SQLDescribeParam.c][185]
        Entry:
            Statement = 0x7f97b2821a00
            Parameter Number = 1
            SQL Type = 0x7f97b2417d52
            Param Def = 0x7f97b2417d58
            Scale = 0x7f97b2417d60
            Nullable = 0x7ffee6d83e48
[ODBC][32303][1612998942.266081][SQLDescribeParam.c][338]
        Exit:[SQL_ERROR]
            SQL Type = 0x7ffee6d83c60
            Param Def = 0x7ffee6d83b70
            Scale = 0x7ffee6d83a80
            Nullable = 0x7ffee6d83990
[ODBC][32303][1612998942.266150][SQLDescribeParam.c][185]
        Entry:
            Statement = 0x7f97b2821a00
            Parameter Number = 2
            SQL Type = 0x7f97b2417dba
            Param Def = 0x7f97b2417dc0
            Scale = 0x7f97b2417dc8
            Nullable = 0x7ffee6d83e48
[ODBC][32303][1612998942.268039][SQLDescribeParam.c][338]
        Exit:[SQL_ERROR]
            SQL Type = 0x7ffee6d83c60
            Param Def = 0x7ffee6d83b70
            Scale = 0x7ffee6d83a80
            Nullable = 0x7ffee6d83990

@ww2406 - Does the msodbcsql install on Mac also install unixODBC 2.3.7 like it does on Linux?
[gord@localhost ~]$ odbcinst -j
unixODBC 2.3.7
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /home/gord/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

@gordthompson looks like it does 2.3.9
odbcinst -j
unixODBC 2.3.9
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /Users/wwelch/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

@ww2406 - I upgraded my Xubuntu 18.04 box to unixODBC 2.3.9 and my test code still runs fine, so it's not an issue with that version of unixODBC per se. This is starting to look like "a Mac thing".

@gordthompson sometimes “think different” goes a step too far ha. Is this something you think there’s realistically a chance of isolating what’s happening?

Is this something you think there’s realistically a chance of isolating what’s happening?

First we need to be sure we're talking about the same thing. Can you verify whether or not my test code from here fails on your Mac. I've demonstrated that it works on Windows and Linux (Ubuntu, at least).

Well...seems a few days break has reset something? Both your test code and my test code are working? I'm very flummoxed now...
I'm glad I had those ODBC traces so you don't think I'm completely crazy!


Llama2 answers is noise

I tried to use Llama2, code is executing but the results are random character, what is wrong?
llm = LLM(model="/home/gpt/.cache/huggingface/hub/models--meta-llama--Llama-2-13b-hf/snapshots/bff3f0e93147eb2c18aa8a888e73f010d8935d17")
prompts = [
    "I am so fast that I can",
    "The capital of France is",
    "The future of AI is",
]
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
outputs = llm.generate(prompts, sampling_params)

# Print the outputs.
for output in outputs:
    prompt = output.prompt
    generated_text = output.outputs[0].text
    print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")

and got
Prompt: 'I am so fast that I can', Generated text: 'hd canciónbólści Zum framідnexProgram nov напskieWrapperabi go totale'
Prompt: 'The capital of France is', Generated text: 'Business Stock vieerves beskrevsiska}$. програкли laugh ","readerattednexшње савезној'
Prompt: 'The future of AI is', Generated text: "pleasure Mohрю Democratic Pel.»)}{ Foi Referencias maven Yeah beyond encryption river Catalunya '"

Is this perhaps a lora/peft model issue? I was looking at #182 and #289 to see if it works with the finetuned model.

Try with the chat version. llama-2-13b-chat-hf.

I think this is because you are using the .safetensors weights, while vLLM doesn't support decode safetensors right now.

Try with the chat version. llama-2-13b-chat-hf.

Same result. i tried before, i was think that version without chat would be more suitable for continue of text

I had this same issue with a finetuned 7b llama2 not using lora or quantization...

Are you using the following tokenizer: 'hf-internal-testing/llama-tokenizer'

Are you using the following tokenizer: 'hf-internal-testing/llama-tokenizer'

In tutorial examples the was no place where you should put specific tokenizer, maybe you can helps and show how to config it

Maybe it's related to safetensors. After converting a baichuan-13b model into safetensor, the output results are completely incorrect. The llama2 chat models are also saved as safetensors.

same issue here

yep. not using safetensors fixed this. thanks @gesanqiu
I first download the model from huggingface by
model = LlamaForCausalLM.from_pretrained(model_name, cache_dir = CACHE_DIR,use_safetensors=False)
tokenizer = LlamaTokenizerFast.from_pretrained(model_name,cache_dir = CACHE_DIR,use_safetensors=False)

and then run it inside vllm

@ktrapeznikov How did you do this? It doesn't seem like there's an obvious way to configure this in vllm?

VLLM only looks for bin files to load model weights. If you want to be able to load safetensors (model loads much faster), you can modify the code at https://github.com/vllm-project/vllm/blob/d2b2eed67c49cdda3c1d6fa09ee2ec128b318138/vllm/model_executor/weight_utils.py#L20
The modified code, which will prioritize loading safetensors files, is as follows.
def _hf_model_weights_iterator(hf_folder):
    hf_safetensors_files = [
        x for x in glob.glob(os.path.join(hf_folder, "*.safetensors"))
    ]
    if len(hf_safetensors_files) != 0:
        from safetensors import safe_open

        hf_safetensors_files = [
            x for x in glob.glob(os.path.join(hf_folder, "*.safetensors"))
        ]
        for safetensor_file in hf_safetensors_files:
            with safe_open(safetensor_file, framework="pt", device="cpu") as f:
                for name in f.keys():
                    yield name, f.get_tensor(name)
        torch.cuda.empty_cache()
    else:
        hf_bin_files = [
            x
            for x in glob.glob(os.path.join(hf_folder, "*.bin"))
            if not x.endswith("training_args.bin")
        ]
        for bin_file in hf_bin_files:
            state = torch.load(bin_file, map_location="cpu")
            for name, param in state.items():
                yield name, param
            del state
            torch.cuda.empty_cache()

def hf_model_weights_iterator(
    model_name_or_path: str,
    cache_dir: Optional[str] = None,
    use_np_cache: bool = False,
) -> Iterator[Tuple[str, torch.Tensor]]:
    # Prepare file lock directory to prevent multiple processes from
    # downloading the same model weights at the same time.
    lock_dir = cache_dir if cache_dir is not None else "/tmp"
    lock_file_name = model_name_or_path.replace("/", "-") + ".lock"
    lock = filelock.FileLock(os.path.join(lock_dir, lock_file_name))

    # Download model weights from huggingface.
    is_local = os.path.isdir(model_name_or_path)
    if not is_local:
        with lock:
            hf_folder = snapshot_download(
                model_name_or_path,
                allow_patterns="*.bin",
                cache_dir=cache_dir,
                tqdm_class=Disabledtqdm,
            )
    else:
        hf_folder = model_name_or_path

    if use_np_cache:
        # Convert the model weights from torch tensors to numpy arrays for
        # faster loading.
        np_folder = os.path.join(hf_folder, "np")
        os.makedirs(np_folder, exist_ok=True)
        weight_names_file = os.path.join(np_folder, "weight_names.json")
        with lock:
            if not os.path.exists(weight_names_file):
                weight_names = []
                for name, param in _hf_model_weights_iterator(hf_folder):
                    param_path = os.path.join(np_folder, name)
                    with open(param_path, "wb") as f:
                        np.save(f, param.cpu().detach().numpy())
                    weight_names.append(name)
                with open(weight_names_file, "w") as f:
                    json.dump(weight_names, f)

        with open(weight_names_file, "r") as f:
            weight_names = json.load(f)

        for name in weight_names:
            param_path = os.path.join(np_folder, name)
            with open(param_path, "rb") as f:
                param = np.load(f)
            yield name, torch.from_numpy(param)
    else:
        for name, param in _hf_model_weights_iterator(hf_folder):
            yield name, param

I've tested llama 2 models with 20 datasets with vllm  and compared it with meta inference code. I have parity when I use

weights downloaded from Huggingface
use bin files

Without using safetensor weights, the noise problem still exists

Is there any way to transform a model from safetensors into the right format? When I try to transform it to binary by loading safetensors in hf and saving them with this:
original_dir = "merged_tuned" #THIS CONTAINS THE SAFETENSORS
model = AutoModelForCausalLM.from_pretrained(original_dir, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(original_dir)

output_dir = "merged_tuned_bin"
model.save_pretrained(output_dir)
tokenizer.save_pretrained(output_dir)

then i'm getting:
llm = LLM(model="merged_tuned_bin")
...
NotImplementedError: Cannot copy out of meta tensor; no data!

Is there any way to transform a model from safetensors into the right format? When I try to transform it to binary by loading safetensors in hf and saving them with this:
original_dir = "merged_tuned" #THIS CONTAINS THE SAFETENSORS
model = AutoModelForCausalLM.from_pretrained(original_dir, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(original_dir)

output_dir = "merged_tuned_bin"
model.save_pretrained(output_dir)
tokenizer.save_pretrained(output_dir)

then i'm getting:
llm = LLM(model="merged_tuned_bin")
...
NotImplementedError: Cannot copy out of meta tensor; no data!

Download from huggingface

yep. not using safetensors fixed this. thanks @gesanqiu
I first download the model from huggingface by
model = LlamaForCausalLM.from_pretrained(model_name, cache_dir = CACHE_DIR,use_safetensors=False)
tokenizer = LlamaTokenizerFast.from_pretrained(model_name,cache_dir = CACHE_DIR,use_safetensors=False)

and then run it inside vllm

It also seems weird because the safetensors saving argument is set to False by default. Check here

weights downloaded from Huggingface

Thank you very much for your suggestion!
weights downloaded from Huggingface. Does it mean
llm = LLM(model="meta-llama/Llama-2-7b-hf", tensor_parallel_size=1, gpu_memory_utilization=0.70)

Or, load the model from a locally saved model file, e.g., a .bin file?
Thank you very much!
Shuyue
Nov. 25th, 2023