Skip to content

Commit

Permalink
[config impact] Remove strict beta mode
Browse files Browse the repository at this point in the history
Reviewed By: ngorogiannis

Differential Revision: D49775792

fbshipit-source-id: c4ceecf109d31590eaaea394c4eca003df83c71d
  • Loading branch information
skcho authored and facebook-github-bot committed Oct 2, 2023
1 parent 457b583 commit a525ab6
Show file tree
Hide file tree
Showing 16 changed files with 9 additions and 71 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ DIRECT_TESTS += \
java_fb-config-impact \
java_fb-config-impact-paths \
java_fb-config-impact-strict \
java_fb-config-impact-strict-beta-paths \
java_fb-immutability \
java_fb-performance
endif
Expand Down
2 changes: 0 additions & 2 deletions infer/documentation/issues/CONFIG_IMPACT_STRICT_BETA.md

This file was deleted.

8 changes: 0 additions & 8 deletions infer/man/man1/infer-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,6 @@ OPTIONS
CONDITION_ALWAYS_TRUE (disabled by default),
CONFIG_IMPACT (disabled by default),
CONFIG_IMPACT_STRICT (disabled by default),
CONFIG_IMPACT_STRICT_BETA (disabled by default),
CONFIG_USAGE (disabled by default),
CONSTANT_ADDRESS_DEREFERENCE (disabled by default),
CONSTANT_ADDRESS_DEREFERENCE_LATENT (disabled by default),
Expand Down Expand Up @@ -2251,13 +2250,6 @@ INTERNAL OPTIONS
--config-impact-previous-reset
Cancel the effect of --config-impact-previous.

--config-impact-strict-beta-mode-paths +path_regex
Similar to --config-impact-strict-mode-paths, but the paths are
used only for beta testing.

--config-impact-strict-beta-mode-paths-reset
Set --config-impact-strict-beta-mode-paths to the empty list.

--config-impact-strict-mode
Activates: Make the config impact analysis stricter. It disables
all heuristics of ignoring cheap method calls. (Conversely:
Expand Down
1 change: 0 additions & 1 deletion infer/man/man1/infer-report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ OPTIONS
CONDITION_ALWAYS_TRUE (disabled by default),
CONFIG_IMPACT (disabled by default),
CONFIG_IMPACT_STRICT (disabled by default),
CONFIG_IMPACT_STRICT_BETA (disabled by default),
CONFIG_USAGE (disabled by default),
CONSTANT_ADDRESS_DEREFERENCE (disabled by default),
CONSTANT_ADDRESS_DEREFERENCE_LATENT (disabled by default),
Expand Down
1 change: 0 additions & 1 deletion infer/man/man1/infer.txt
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,6 @@ OPTIONS
CONDITION_ALWAYS_TRUE (disabled by default),
CONFIG_IMPACT (disabled by default),
CONFIG_IMPACT_STRICT (disabled by default),
CONFIG_IMPACT_STRICT_BETA (disabled by default),
CONFIG_USAGE (disabled by default),
CONSTANT_ADDRESS_DEREFERENCE (disabled by default),
CONSTANT_ADDRESS_DEREFERENCE_LATENT (disabled by default),
Expand Down
2 changes: 1 addition & 1 deletion infer/src/atd/jsonconfigimpact.atd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
type loc <ocaml from="Jsonbug"> = abstract
type sub_item <ocaml from="Jsoncost"> = {hash: string ; loc: loc ; procedure_name: string ; procedure_id: string }

type config_impact_mode = [Normal | StrictBeta | Strict]
type config_impact_mode = [Normal | Strict]

type item = {
inherit sub_item;
Expand Down
10 changes: 4 additions & 6 deletions infer/src/base/Config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1224,8 +1224,10 @@ and config_impact_strict_mode_paths =
runs as non-strict mode; otherwise, it runs as strict mode, but for all paths."


and config_impact_strict_beta_mode_paths =
CLOpt.mk_string_list ~long:"config-impact-strict-beta-mode-paths" ~meta:"path_regex"
and _config_impact_strict_beta_mode_paths =
CLOpt.mk_string_list
~deprecated:["-config-impact-strict-beta-mode-paths"]
~long:"" ~meta:"path_regex"
"Similar to $(b,--config-impact-strict-mode-paths), but the paths are used only for beta \
testing."

Expand Down Expand Up @@ -3839,10 +3841,6 @@ and config_impact_strict_mode = !config_impact_strict_mode

and config_impact_strict_mode_paths = RevList.rev_map !config_impact_strict_mode_paths ~f:Str.regexp

and config_impact_strict_beta_mode_paths =
RevList.rev_map !config_impact_strict_beta_mode_paths ~f:Str.regexp


and config_impact_test_paths = RevList.rev_map !config_impact_test_paths ~f:Str.regexp

and continue_analysis = !continue_analysis
Expand Down
2 changes: 0 additions & 2 deletions infer/src/base/Config.mli
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ val config_impact_strict_mode : bool

val config_impact_strict_mode_paths : Str.regexp list

val config_impact_strict_beta_mode_paths : Str.regexp list

val config_impact_test_paths : Str.regexp list

val continue_analysis : bool
Expand Down
5 changes: 0 additions & 5 deletions infer/src/base/IssueType.ml
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,6 @@ let config_impact_analysis_strict =
~user_documentation:[%blob "./documentation/issues/CONFIG_IMPACT_STRICT.md"]


let config_impact_analysis_strict_beta =
register ~enabled:false ~id:"CONFIG_IMPACT_STRICT_BETA" Advice ConfigImpactAnalysis
~user_documentation:[%blob "./documentation/issues/CONFIG_IMPACT_STRICT_BETA.md"]


let pulse_config_usage =
register ~enabled:false ~id:"CONFIG_USAGE" Info Pulse
~user_documentation:[%blob "./documentation/issues/CONFIG_USAGE.md"]
Expand Down
2 changes: 0 additions & 2 deletions infer/src/base/IssueType.mli
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ val config_impact_analysis : t

val config_impact_analysis_strict : t

val config_impact_analysis_strict_beta : t

val pulse_config_usage : t

val pulse_const_refable : t
Expand Down
14 changes: 3 additions & 11 deletions infer/src/cost/ConfigImpactAnalysis.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ let is_in_strict_mode_paths file =
SourceFile.is_matching Config.config_impact_strict_mode_paths file


let is_in_strict_beta_mode_paths file =
SourceFile.is_matching Config.config_impact_strict_beta_mode_paths file


let is_in_test_paths file = SourceFile.is_matching Config.config_impact_test_paths file

let mode =
Expand All @@ -30,13 +26,9 @@ let mode =
| None ->
(* NOTE: ConfigImpact analysis assumes that non-empty changed files are always given. The
next condition check is only for checker's tests. *)
if not (List.is_empty Config.config_impact_strict_mode_paths) then `Strict
else if not (List.is_empty Config.config_impact_strict_beta_mode_paths) then `StrictBeta
else `Normal
if not (List.is_empty Config.config_impact_strict_mode_paths) then `Strict else `Normal
| Some changed_files ->
if SourceFile.Set.exists is_in_strict_mode_paths changed_files then `Strict
else if SourceFile.Set.exists is_in_strict_beta_mode_paths changed_files then `StrictBeta
else `Normal
if SourceFile.Set.exists is_in_strict_mode_paths changed_files then `Strict else `Normal


module Branch = struct
Expand Down Expand Up @@ -967,7 +959,7 @@ module Dom = struct
in
let is_unmodeled_call = match instantiated_cost with Some NoModel -> true | _ -> false in
match mode with
| `StrictBeta | `Strict -> (
| `Strict -> (
let is_static = Procname.is_static callee in
match (callee_summary, expensiveness_model) with
| _, Some KnownCheap ->
Expand Down
2 changes: 0 additions & 2 deletions infer/src/cost/ConfigImpactAnalysis.mli
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ val pp_mode : Format.formatter -> mode -> unit

val is_in_strict_mode_paths : SourceFile.t -> bool

val is_in_strict_beta_mode_paths : SourceFile.t -> bool

val mode : mode

module LatentConfig : sig
Expand Down
8 changes: 1 addition & 7 deletions infer/src/integration/ConfigImpactIssuesTest.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ let pp_custom_of_config_impact_report fmt report =
let pp_custom_of_config_impact_issue fmt (config_impact_item : Jsonconfigimpact_t.item) =
let open Jsonbug_t in
F.fprintf fmt "%s%s, %s, {%a}@\n"
( match config_impact_item.mode with
| `Normal ->
""
| `StrictBeta ->
"[STRICT BETA] "
| `Strict ->
"[STRICT] " )
(match config_impact_item.mode with `Normal -> "" | `Strict -> "[STRICT] ")
config_impact_item.procedure_name config_impact_item.loc.file
ConfigImpactAnalysis.UncheckedCallees.pp_without_location
(ConfigImpactAnalysis.UncheckedCallees.decode config_impact_item.unchecked_callees)
Expand Down
2 changes: 0 additions & 2 deletions infer/src/integration/Differential.ml
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,6 @@ module ConfigImpactItem = struct
match config_impact_item.mode with
| `Normal ->
IssueType.config_impact_analysis
| `StrictBeta ->
IssueType.config_impact_analysis_strict_beta
| `Strict ->
IssueType.config_impact_analysis_strict
in
Expand Down
1 change: 0 additions & 1 deletion infer/src/integration/JsonReports.ml
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ let write_config_impact proc_name loc config_impact_opt (outfile : Utils.outfile
Config.is_checker_enabled Checker.ConfigImpactAnalysis
&& ( (Config.config_impact_strict_mode && List.is_empty Config.config_impact_strict_mode_paths)
|| ConfigImpactAnalysis.is_in_strict_mode_paths loc.Location.file
|| ConfigImpactAnalysis.is_in_strict_beta_mode_paths loc.Location.file
|| ExternalConfigImpactData.is_in_config_data_file proc_name )
&& is_in_files_to_analyze loc
then
Expand Down

This file was deleted.

0 comments on commit a525ab6

Please sign in to comment.